How to force a ScriptUI docked panel to resize/update
Hi, I've been trying to figure this out for days now. I've searched everything I can think to search and can't find a suitable answer.
I have a function that hides a child panel. This works fine, but leaves a space where the panel used to be. If I manually resize my docked window it fixes the issue, but I want it to do this automatically without manually resizing. Is there a way to force the docked window to resize? Or is there some other way to do this?
I'm using .layout() and an onResize function to accomplish what I have so far. I've tried playing with the windows max size but again, this doesn't show until a resize happens and it only affects the inner elements, not the actual docked window size. I've tried using a notify("onResize") but it always throws an error saying notify is undefined. I'm missing some fundamental understanding here, but I don't know what.
To summarize what I want to do: When a button is clicked in a docked window, I want to hide a panel in that window and have the extra space hidden too, without having to manually resize. I also want to reverse this.
Here's a small portion of my code to show you where I'm at with this:
function buttonHelpTestDown () {
var maxSize = pnl.grp.maximumSize;
if (pnl.grp.groupControls.groupTools.groupBuildCurvePreset.panelBuildCurve.maximumSize[0] > 0) {
pnl.grp.groupControls.groupTools.groupBuildCurvePreset.panelBuildCurve.maximumSize = [0,0];
} else {
pnl.grp.groupControls.groupTools.groupBuildCurvePreset.panelBuildCurve.maximumSize = maxSize;
}
//prevent draw panel from disappearing
var drawSize = pnl.grp.panelGridDraw.size;
pnl.grp.panelGridDraw.minimumSize = drawSize;
//refresh layout
pnl.layout.layout(true);
//reset draw panel min size
pnl.grp.panelGridDraw.minimumSize = [0,0];
}
pnl.layout.resize();
pnl.onResizing = pnl.onResize = function() {
this.layout.resize();
}I'm so close to getting this to work right. Any help would be appreciated!
Thanks.
