Hi folks,
I'm looking at improving iPython integration with wxPython. My goal is to be able to run my wxPython app from the iPython command line, and run it over an over again. Recently, iPython has made some improvements to how this can be done (see trunk). It does require a bit of special code at startup, but it works nicely for me so far.
However, there is this problem, from the iPython examples:
"""
This example can only be run once in a given IPython session because when the frame is closed, wx goes through its shutdown sequence, killing further attempts. I am sure someone who knows wx can fix this issue.
Furthermore, once this example is run, the Wx event loop is mostly dead, so even other new uses of Wx may not work correctly. If you know how to better handle this, please contact the ipython developers and let us know.
"""
What I'm thinking is that if there is an event you can bind in your app object when wx is about to shut down, and veto that event, then the main code could be run again, and it would just have to check if an ap had already been created.
Ideally, the apps OnInit would get re-run too -- I'd have to think about that first.
But first, I need to know if there is an event that I can catch and veto -- essentially letting the app stay running once all the Windows are closed.
If anyone's got any other ideas about how to make this work, I'm all ears.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception