feature request: optionally deleting the whole chain of event handlers, when window is deleted

Vadim Zeitlin vadim at wxwidgets.org
Mon Feb 4 01:24:50 PST 2008


On Mon, 4 Feb 2008 01:11:43 -0800 (PST) chris <cb at delta-h.de> wrote:

c> > c> That's because I dont want to call 'delete this' anywhere.
c> >
c> >  Is there any reason for this?
c> 
c> Yes. Try googling for 'delete this'. It's not known as a good design
c> choice.

 Sorry, but this is not a convincing argument: Try googling for anything.
You will find someone arguing for it.

 Whatever philosophical objections you may have to this technique, it is
perfectly legal and is the best design possible in some (well known) cases.
This is one of them and wx already uses it in a few other cases.

c> > I don't see any problem with catching wxEVT_CLOSE_WINDOW

 BTW, it's wxEVT_DESTROY, not wxEVT_CLOSE_WINDOW, which should be used. It
is definitely sent for all the windows and in well-defined order (that of
their destruction).

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list