[wxPython-users] Wait for frame to be closed?

Mike Rooney mxr at qvii.com
Fri Apr 27 06:37:15 PDT 2007


Grant Edwards wrote:
> How does one wait for a frame to be closed?
>
> There's a spot in my code where I create a frame (f), make it
> modal by calling f.MakeModal(True), and then do f.Show().  What I
> really want to do is f.ShowModal(), but it's a frame not a
> dialog.
>   

I hope you know what you are doing making a Frame a modal! :)

> The question is how do I then wait for the frame to be closed
> so I can call f.MakeModal(False) after the frame has been
> closed?  
>
> The frame is created using a Frame subclass provided by an
> imported module, so is it kosher for the importing module to
> bind something to the frame's EVT_CLOSE event?
>
>   

I think this is kosher. If the frame isn't already created you could 
import the class, subclass, and just define an __init__ which calls the 
supers init and binds to a handler which you also add to your subclass. 
Otherwise I think you are fine binding to the already-created frame's 
EVT_CLOSE.

- Mike Rooney





More information about the wxpython-users mailing list