git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15194
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
# and the refresh event
EVT_PAINT(self, self.OnPaint)
+ # When the window is destroyed, clean up resources.
+ EVT_WINDOW_DESTROY(self, self.Cleanup)
- def __del__(self):
- self.Cleanup()
-
- def Cleanup(self):
+ def Cleanup(self, evt):
if hasattr(self, "menu"):
self.menu.Destroy()
del self.menu
self.SetAutoLayout(true)
self.SetSizer(box)
- EVT_CLOSE(self, self.OnCloseWindow)
-
-
- def OnCloseWindow(self, event):
- self.doodle.Cleanup()
- self.Destroy()
-
def SaveFile(self):
if self.filename: