View Full Version : "scriptJob -uiDeleted" Question

01 January 2008, 12:01 AM
window -title "Close Me" myWindow;
showWindow myWindow;

// Use a scriptJob to pop up a farewell message when the window is closed
scriptJob -uiDeleted myWindow "confirmDialog -message \"Buh-bye!\"";

Techically, if you put this command in your createWindow function, should you also be handing it a "-runOnce" flag? Correct? I am pretty sure the answer is "yes".


01 January 2008, 02:12 AM
I think intuitively the answer would be no :). That is because you attach the scriptJob to an event of some UI object destruction. That basically can occur only once. There is no way that a window is going to be deleted twice. So I would assume Maya destroys your scriptJob after the UI is deleted and your custom code gets called. I personally would not provide the run once flag, unless otherwise Maya starts behaving weirdly.

Cheers :)

CGTalk Moderation
01 January 2008, 02:12 AM
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.