You can also use the API's MUiMessage_addUiDeletedCallback. Example of that + scriptJob here: http://mayamel.tiddlyspot.com/#%5B%5BHow%20can%20I%20execute%20code%20when%20a%20window%20is%20deleted%3F%5D%5D
If the window is closed, that callback is triggered, and then you can do anything you want based on that condition. The difference I've found is, the api callback runs just before the window is deleted (allowing you to grab data from the window before it dies), the scriptJob runs just after. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/eacf8718-729c-477e-8aea-ba08d7d6c8d4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.