• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How modify a window after w.show()

Community Beginner ,
May 14, 2012 May 14, 2012

Copy link to clipboard

Copied

Hello!

I need to redraw a window but i cant figure it out!? Do i need to close it first?

w = new Window("dialog","Test");

test1 = w.add("statictext",undefined,"test1");     //Shows up

w.show();

test2 = w.add("statictext",undefined,"test2");     // Does not show!

w.show();

app.redraw();

Any ideas?

// Aasdfasdfasdfasdf

TOPICS
Scripting

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , May 14, 2012 May 14, 2012

One button is OK, click to add, click once again to delete.

var w = new Window("dialog","Test");

var btn = w.add("button",undefined,"add/del statictext");

var test1 = w.add("statictext",undefined,"test1");

var test2 = null;

btn.onClick = function () {

          if (!test2) {

                    test2 = w.add("statictext",undefined,"test2");

          } else {

                    w.remove(test2);

                    test2= null;

          }

    w.layout.layout(1);

}

w.show();

Votes

Translate

Translate
Adobe
Advocate ,
May 14, 2012 May 14, 2012

Copy link to clipboard

Copied

Hi asdfasdfasdf

Can I order you please to rename and use another profile name?

It´s just to prevent your current name to be considered Spam.

Thank you a lot and best regards

Gustavo

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 14, 2012 May 14, 2012

Copy link to clipboard

Copied

yeah i know, when i created the account i tried at least 15 regular usernames but it said that all was taken!! So i got mad and just typed something

Now when i change the username it says that its been changed but nothing is happening so i dont know!! im mad again...Grrr

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 14, 2012 May 14, 2012

Copy link to clipboard

Copied

Method 1: use a button to ctrl

var w = new Window("dialog","Test");

var btn = w.add("button",undefined,"add statictext");

var test1 = w.add("statictext",undefined,"test1");

btn.onClick = function () {

    var test2 = w.add("statictext",undefined,"test2");

    w.layout.layout(1);

}

w.show();

Method 2: use a palette window

w = new Window("palette","Test");

test1 = w.add("statictext",undefined,"test1");

w.show();

$.sleep(500); // don't need, just for demo

test2 = w.add("statictext",undefined,"test2");

w.layout.layout(1);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 14, 2012 May 14, 2012

Copy link to clipboard

Copied

Thaanks man!

Now i know how to add a staticfield with a button but, what if i want to remove it with another button?

Is that possible?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 14, 2012 May 14, 2012

Copy link to clipboard

Copied

One button is OK, click to add, click once again to delete.

var w = new Window("dialog","Test");

var btn = w.add("button",undefined,"add/del statictext");

var test1 = w.add("statictext",undefined,"test1");

var test2 = null;

btn.onClick = function () {

          if (!test2) {

                    test2 = w.add("statictext",undefined,"test2");

          } else {

                    w.remove(test2);

                    test2= null;

          }

    w.layout.layout(1);

}

w.show();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 15, 2012 May 15, 2012

Copy link to clipboard

Copied

LATEST

Aah nice! Thanks u so much!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines