View Full Version : Weird layoutDialog issue - a bug?

12 December 2012, 11:46 AM

so I'm having a very weird issue while using a layoutDialog in one of my scripts:

Basically I have a window, which is the -content of a dockControl. I'm using -resizeCommands to set and retrieve the window's width via optionVars.

One button in my window creates a layoutDialog, and here's the issue: as soon as I invoke the button, my -resizeCommand script fails with the warning:
'Error: window: object <mywindowname> not found'

The -resizeCommand works fine up until the moment the layoutDialog appears (or rather: as soon as its dismissed. Since it's modal I cannot test whether the script works while the dialog is open).

The weirdest part is that the specified window does exist. If I run lsUI -type window then bam, there it is. BUt I cannot query it via window -q -ex <windowname> anymore, as that returns 0.

Here's a quick and dirty test scenario I made so others can verify this behaviour:
global proc ldUI() {
$form = `setParent -q`;
$button = `button
-w 70
-l "Dismiss"
-c "layoutDialog -dis \"Dismiss\""`;
formLayout -e
-w 100 -h 50
-af $button "top" 4
-af $button "left" 4
$window = `window
-title "testWindow"
button -l "dialog" -c "layoutDialog -ui \"ldUI\"";
button -l "check" -c "print(\"Window exists: \" + `window -q -ex myTestWindow` + \"\\n\")";
button -l "list windows" -c "lsUI -type window";

-aa "left" -aa "right"
-a "left"
-fl 1
-content $window

If you hit "check" right after running the above script, it will return 1. If you then click the 'dialog' button and dismiss the dialog, clicking 'check' will return 0.
You can click 'list windows' to verify that the window "myTestWindow" is in fact still there.

Does anyone have a clue what's going on?

12 December 2012, 04:05 PM
Really, no one?

That's too bad as this is a pretty major issue in my project... :(

CGTalk Moderation
12 December 2012, 04:05 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.