X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7114b9fa28654f7a9c118f6574f7c8e15fa5d302..ccdcde00d9ae27ca20ff6c3c9495918a0ec725aa:/wxPython/samples/doodle/superdoodle.py diff --git a/wxPython/samples/doodle/superdoodle.py b/wxPython/samples/doodle/superdoodle.py index 68584ed27e..92fdf37ae8 100644 --- a/wxPython/samples/doodle/superdoodle.py +++ b/wxPython/samples/doodle/superdoodle.py @@ -35,7 +35,8 @@ class DoodleFrame(wxFrame): """ title = "Do a doodle" def __init__(self, parent): - wxFrame.__init__(self, parent, -1, self.title, size=(800,600)) + wxFrame.__init__(self, parent, -1, self.title, size=(800,600), + style=wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) self.CreateStatusBar() self.MakeMenu() self.filename = None @@ -55,6 +56,13 @@ class DoodleFrame(wxFrame): 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: