Copy link to clipboard
Copied
Hello friends!
Can anyone explain why when using "w.layout.layout(true)" all the elements of the window are resized making a mess and running away from the original sizes? Initially I created my windows with undefined sizes using this great site: https://scriptui.joonas.me/ but I got this defect, then I tried to use another method determined the sizes of each element but the error continues.
Could someone out there show me the best method when I need to use the refresh window? Thanks.
w = new Window ('dialog');
w.preferredSize = [300, 400];
w.grp1 = w.add ('group');
w.grp1.add('panel', [0,0,100,100], 'None');
w.grp1.add('panel', [0,0,100,100], 'Gray');
w.grp1.add('panel', [0,0,100,100], 'Black');
w.grp1.add('panel', [0,0,100,100], 'White');
w.grp2 = w.add ('group');
w.grp2.add('panel', [0,0,100,100], 'Etched');
w.grp2.add('panel', [0,0,100,100], 'Sunken');
w.grp2.add('panel', [0,0,100,100], 'Raised');
b2 = w.add("button", [0,0,100,25]); b2.text = "Updade W";
b2.onClick = function(){
w.layout.layout(true)
};
w.show();
JavaScript Tools Guide p. 165
Yes, this is normal behavior, because when you call the function, you specify recalculate = true. If the panel does not contain any elements, its size is recalculated.
Copy link to clipboard
Copied
JavaScript Tools Guide p. 165
Yes, this is normal behavior, because when you call the function, you specify recalculate = true. If the panel does not contain any elements, its size is recalculated.
Copy link to clipboard
Copied
Thanks @jazz-y . I'm going to do some tests here.