X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c2dac7366ce3bdfaab2d49fc043dceb25b9c0709..d2c7015bf07982c3b9c3e8ca62b326e589f95e46:/wxPython/demo/ActiveXWrapper_IE.py diff --git a/wxPython/demo/ActiveXWrapper_IE.py b/wxPython/demo/ActiveXWrapper_IE.py index c91db4d56b..2e23f54545 100644 --- a/wxPython/demo/ActiveXWrapper_IE.py +++ b/wxPython/demo/ActiveXWrapper_IE.py @@ -104,14 +104,19 @@ class TestPanel(wxWindow): self.SetAutoLayout(true) EVT_SIZE(self, self.OnSize) + EVT_WINDOW_DESTROY(self, self.OnDestroy) - def OnSize(self, evt): - self.Layout() - def __del__(self): + def OnDestroy(self, evt): if self.ie: self.ie.Cleanup() self.ie = None + self.frame = None + + + def OnSize(self, evt): + self.Layout() + def OnLocationSelect(self, evt): url = self.location.GetStringSelection() @@ -213,11 +218,10 @@ if __name__ == '__main__': self.tp = TestPanel(self, sys.stdout, self) EVT_CLOSE(self, self.OnCloseWindow) - def OnCloseWindow(self, event): - self.tp.ie.Cleanup() + def OnCloseWindow(self, evt): + self.tp.Destroy() self.Destroy() - app = wxPySimpleApp() frame = TestFrame() frame.Show(true)