wxPython: EVT_CLOSE question

alan scales alans at killergame.com
Sun Feb 17 22:33:01 EST 2002


Vadim Zeitlin <zeitlin at seth.lpthe.jussieu.fr> wrote in message news:<slrna6tjb6.e10.zeitlin at seth.lpthe.jussieu.fr>...
> On 15 Feb 2002 17:02:45 -0800, alan scales <alans at killergame.com> wrote:
> > i have some controls (in particular wxStyledTextCtrl) - they are NOT
> > frames or dialogs.  I want to be able to trap when they are closed (or
> > destroyed)(e.g. to save data). I was hoping to use EVT_CLOSE and
> > provide a handler.  however it does not seem to work.
> > 
> >   1. is it supposed to work? (it is only documented for
> > frames/dialogs)
> 
>  No, it isn't supposed to work for the simple controls. It only works for he
> top level windows.
> 
> >   2. if not, what can be done to detect when a control is closed?
> 
>  The best would be to do it in EVT_CLOSE of the frame containing the control.
> You also can use EVT_WINDOW_DESTROY but this could be too late to do anything
> meaningful with the control.
> 
>  Regards,
> VZ

the frame containing the control isn't being closed (the controls in
question are sort of being "paged in and out" - maybe this is
pathological application). however, the EVT_WINDOW_DESTROY might be
made to work.


thanks, 
as



More information about the Python-list mailing list