Skip to main content
Inspiring
November 4, 2014
Answered

Update the Window onChange?

  • November 4, 2014
  • 2 replies
  • 945 views

Hey guys,

how can I update my window with the onChange event? My solution works, but I need the groups to collapse when not visible.

w.DD.onChange = function() {

     switch (this.selection.text){

          case 'Headline':

               if(w.visiblegroup)

               w.visiblegroup.visible = false;

               w.visiblegroup = w.texted;

               w.texted.visible = true;

          break;

     }

}

I have tried to use w.show, w.update(with documentation, still not sure what .update actually does) after adding the elements in the case itself. But I can't figure this out.

w.DD.onChange = function() {

     switch (this.selection.text){

          case 'Headline':

               w.add('checkbox', undefined, 'User-Color');

               //w.show();

               w.update();

          break;

     }

}

Does anyone have a clue how this might work?

Thanks in advance!

This topic has been closed for replies.
Correct answer Trevor:

w.layout.layout( true );

Should be called after you have added / removed items.

P.


Hi Pickory, Stamn

Actually there's no such think really as w.layout.layout(true) see Marc's http://indiscripts.com/blog/public/LayoutManager-Draft.pdf and Re: Documentation of ScriptUI window.update()?,

It's either w.layout.layout(0), w.layout.layout(1) or w.layout.layout(2)

w.layout.layout(true) would be evaluated to the save as w.layout.layout(1) in Stamn case he would probably want to got for w.layout.layout(2)

This little example nicely illustrates the difference between (1) and (2).

Regards

Trevor

2 replies

StammAuthor
Inspiring
November 17, 2014

Does anyone have a solution for this? I am still struggling. Or didn't I provide enough information?

Legend
November 17, 2014

Try w.layout.layout( true );

P.

StammAuthor
Inspiring
November 17, 2014

Hey,

I've tried the following:

var w = new Window('dialog');

w.layout.layout(true);

w.size=[200,200];

button1= w.add('button', undefined, 'submit');

button1.onClick= function(){

   w.add('statictext', undefined, 'HALLO');

}

w.show();

It sadly does not work.

Peter Spier
Community Expert
Community Expert
November 4, 2014

Moved to scripting...