Hook when dialog shuts down

I want to get notified when my ELF window is closing and pull some information out of it at that point. So far, I haven't been able to do this. I thought a scriptJob with the -uid would work but this runs the script job after the UI has actually been deleted, not immediately before it's deletion, so at that point it's too late to pull the info from the window. I thought surely there would be an option on the window to "run this script when the window closes" but there doesn't seem to be so that's not an option either. I then thought that if we could make the only way to close the window a "close" button, I could grab the info there. Unfortunately the only way I can see of eliminating the close window button in the upper right is to eliminate the title bar which has the annoying side effect of disabling the ability to move the window which shuts out that possibility. So nothing I've been able to think of will work the way I want it to so far. It's hard for me to believe that this isn't possible (maybe it's my Windows background where the place you normally get the info from a dialog is when it's shut down) but I'm beginning to come to that conclusion. Has anybody got any ideas on how I can get this to work?

a while back i copied the renderglobals.mel and hacked it so that all the procedures could attian their values as arguments instead of from the renderglobals interface. this allowed me to use the procedures as commands with arguments that i could create presets for so that i could make a button that would for instance, create a lowres thumbnail, or lowres test render, or hires test etc... without haveing to painstakeingly set them all in the interface.

render globals.mel samples the settings from the interface and somehow stores them when you close the window. it might be worth taking a look at for your problem.

markt

Thanks for the pointer. I looked at this and it looks like they use retained mode for their dialog so it never really goes down - it just gets hidden. I thought of using a retained window but in our situation I want to take action immediately when the window is "closed" so I can prompt the user whether they want to save changes or not. Unfortunately, I don't see a hook for this event either (and scriptJob -uid didn't work since it's not actually being deleted) so I gave up on that one also. In the Render Globals window they don't do anything like that so don't have to worry about it.

I had a similar problem , and I used scriptjob -uideleted
the trick is to make some global vars which contain the
window information needed, after -uideleted executed,
you can still read the information from the global vars,
thats how I solved the problem.

Unfortunately, one of the fields (actually, about the only field) in the dialog is a text field and sadly, Maya doesn't give any hooks for when the user edits a text field so I can't keep an up to date copy of the text in memory which keeps this from working in my case.