When you say "command window" do you mean the DOS command-line window or a window that is part of your application and that has the function above bound as the EVT_CLOSE handler?
In either case, try removing the sys.exit so the self.Destroy() call can happen. (sys.exit simply raises a SystemExit exception which is probably being caught by the normal exception checking code in the wx wrappers, but it is causing the Destroy to be bypassed because of the exception.)
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
even when i am not executing the code and directly close the GUI application it prompts some message.. so i m thinking what can be the problem. i used sys.exit() because i have threads running in the program and i was not able to find a decent way to stop them before closing the application.
And i m not able to read the error message as it gets poped up and closed within a fraction of a second.. is there any way to hold the command window so that i can read the error ??? like in a c program you have getch() command which would wait for a keyboard input and then closes the cmd....