Hi. I'd like to know how I can get a Modal window to resize automatically when some of its display boxes are collapsed. Here's the window initially:
Then after pressing "Toggle View" to insert a display box to the left of the initial box. All is well so far:
And finally after pressing "Toggle View" again to remove (Collapse) the display box I just inserted:
The container display box (a line up box, colored in cyan) has shrunk back down to the desired size, but the window still remains at its expanded size. Any ideas on how I can fix this so that the window shrinks back down? Interestingly, this problem occurs only if the window is modal. Regular windows shrink back to their original size just fine.
Here's some code that reproduces the issue:
Names Default to Here(1);
optional_pb = PanelBox("Optional Stuff",
TextBox("I appear only when the button is clicked.")
);
optional_pb << Visibility(Collapse);
constant_pb = PanelBox("Constant Stuff",
TextBox("I'm always here.")
);
toggleview_bb = ButtonBox("Toggle View",
vizstatus = optional_pb << Get Visibility;
If(vizstatus == "Visible",
optional_pb << Visibility(Collapse);
,
optional_pb << Visibility(Visible);
)
);
lub = LineUpBox(NCol(3), Spacing(5),
optional_pb,
constant_pb,
toggleview_bb
);
lub << Background Color("Cyan");
win = New Window("Test Window",
<< Modal, //If I comment this out, the window behaves. Why?
lub
);
I've also looked into the " << Reshow" command, but honestly I have no clue what it does. Does not appear to help, at any rate.
JMP Pro 15.2.1
Mac OS Big Sur 11.6.4
Thanks!