wxPython: EVT_CLOSE question

Vadim Zeitlin zeitlin at seth.lpthe.jussieu.fr
Sat Feb 16 16:21:43 EST 2002


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
-- 
GCS/GM d? H+ s++:-- p2 au--- a- w+ v C+++ UBLS+++ P- L++ N++ E--- W++++ M? V--
-po+ R++ G`` !tv b+++ D--- e++++ u++ h--- f+ r++ n- y?



More information about the Python-list mailing list