[PythonCE] PPYGUI - parent window and closing it

Adam Walley adam.walley at gmail.com
Thu Jul 10 13:54:18 CEST 2008


Hello, Alexandre.

I have begun testing some ideas using the PPYGUI and find it very easy to
work with. However, I would like to ask if there is a way to know when the
user has pressed the 'X' button in the top right of the window to close the
app? The reason I ask, is that when I run some ppygui code a blank Python
window opens, then the ppygui app window opens on top of it. When I close
the app using the top right 'X' I am returned to the blank Python window.
This is very similar to the situation on the desktop version of Python,
where a terminal window opens unless your Python file is run with the .pyw
extension.

I can implement a 'close' button that executes the sys.exit() command, and
this successfully closes the app and the blank Python terminal window
together. Nevertheless that top right 'X' is still there, and I would prefer
the users of my app to have something consistent and which behaves as
expected (i.e when you press 'X' the app exits or at least is hidden fully).

How do it detect this 'close' event for the main app?

Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonce/attachments/20080710/042dcbeb/attachment.htm>


More information about the PythonCE mailing list