diff --git a/wxPython/demo/CustomDragAndDrop.py b/wxPython/demo/CustomDragAndDrop.py index b93bceb96c..4cb3bff9e4 100644 --- a/wxPython/demo/CustomDragAndDrop.py +++ b/wxPython/demo/CustomDragAndDrop.py @@ -304,6 +304,7 @@ if __name__ == '__main__': class TestApp(wxApp): def OnInit(self): + wxInitAllImageHandlers() self.MakeFrame() return true diff --git a/wxPython/demo/Throbber.py b/wxPython/demo/Throbber.py index c2ff30122e..58583c9826 100644 --- a/wxPython/demo/Throbber.py +++ b/wxPython/demo/Throbber.py @@ -126,7 +126,7 @@ class TestPanel(wxPanel): EVT_WINDOW_DESTROY(self, self.OnDestroy) def OnDestroy(self, event): - self.log.write("got it") + self.log.write("got destroy event") event.Skip() def OnStartAnimation(self, event): @@ -155,7 +155,7 @@ class TestPanel(wxPanel): def runTest(frame, nb, log): if wxPlatform == "__WXMAC__": - wxMessageBox("This demo currently fails on the Mac, I think because of the lack of EVT_WINDOW_DESTROY...", + wxMessageBox("This demo currently fails on the Mac.", "Sorry") return else: diff --git a/wxPython/demo/run.py b/wxPython/demo/run.py index 17a1694a54..13ec8a7e43 100755 --- a/wxPython/demo/run.py +++ b/wxPython/demo/run.py @@ -52,6 +52,8 @@ class RunDemoApp(wxApp): menuBar.Append(menu, "&File") frame.SetMenuBar(menuBar) frame.Show(true) + EVT_CLOSE(frame, self.OnCloseFrame) + win = self.demoModule.runTest(frame, frame, Log()) # a window will be returned if the demo does not create @@ -60,6 +62,7 @@ class RunDemoApp(wxApp): # so set the frame to a good size for showing stuff frame.SetSize((640, 480)) win.SetFocus() + self.window = win else: # otherwise the demo made its own frame, so just put a @@ -84,6 +87,13 @@ class RunDemoApp(wxApp): def OnButton(self, evt): self.frame.Close(true) + + def OnCloseFrame(self, evt): + if hasattr(self, "window") and hasattr(self.window, "ShutdownDemo"): + self.window.ShutdownDemo() + evt.Skip() + + #---------------------------------------------------------------------------- diff --git a/wxPython/demo/wxDragImage.py b/wxPython/demo/wxDragImage.py index 7ab24df8b9..9f39debc3f 100644 --- a/wxPython/demo/wxDragImage.py +++ b/wxPython/demo/wxDragImage.py @@ -16,7 +16,7 @@ class DragShape: def HitTest(self, pt): rect = self.GetRect() - return rect.Inside(pt.x, pt.y) + return rect.InsideXY(pt.x, pt.y) def GetRect(self): @@ -274,3 +274,10 @@ def runTest(frame, nb, log): overview = """\ """ + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])]) + diff --git a/wxPython/demo/wxMask.py b/wxPython/demo/wxMask.py index 73402412eb..d6680f096c 100644 --- a/wxPython/demo/wxMask.py +++ b/wxPython/demo/wxMask.py @@ -114,3 +114,11 @@ def runTest(frame, nb, log): overview = """\ """ + + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])]) +