Command window not getting closed

Varsha Purohit wrote:

Hello All,

        I have made a GUI program, when i click on the close button the command window is not getting closed. Here is the program for the close button...

def OnCloseWindow(self,event):
        self.timer.Stop()
        sys.exit()
        self.Destroy()

Can anyone tell me what is the problem?

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!

Varsha Purohit wrote:

yeahh i m talkin abt the dos command window....

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....

http://wiki.wxpython.org/Frequently_Asked_Questions#head-3876c52e4b36f5bad7c0da1cccecfe288a163fb3

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thank you all for the insight !!!

···

On Tue, Feb 26, 2008 at 1:12 PM, Robin Dunn robin@alldunn.com wrote:

Varsha Purohit wrote:

yeahh i m talkin abt the dos command window…

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…

http://wiki.wxpython.org/Frequently_Asked_Questions#head-3876c52e4b36f5bad7c0da1cccecfe288a163fb3

Robin Dunn

Software Craftsman

http://wxPython.org Java give you jitters? Relax with wxPython!


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org

For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org


Varsha Purohit,
Graduate Student