IOW, there are many situations when your Destroy() in __del__ is not
going to do what you want it to.
···
On Wed, 25 Aug 2004 16:32:08 +0200, Vladimir Gritsenko <vladimir.gritsenko@gmail.com> wrote:
On Wed, 25 Aug 2004 16:21:57 +0200, Jean-Michel Fauth > <jmfauth@bluewin.ch> wrote:
> Hi,
>
> The class wx.Frame (eg) have not a __del__ method.
> Is there any (valid) reason for this?
>
AFAIK, __del__ shouldn't be used, ever. Instead, use f.Destroy() when
you want to destroy it, and catch the OnDestroy event.
The __del__ method will only be called when there are no more references to the object, which may or may not be true when the del statement is executed. In fact, in the case of wx.Frame it will never be true since the C++ object is holding a reference to the Python object. So __del__ will not be called until the C++ object is destroyed, and so at that point there will certainly be no need to call self.Destroy!
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!