demo tweaks

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-02-20 19:18:42 +00:00
parent 6ceec818b2
commit 3b2012561d
5 changed files with 29 additions and 3 deletions

View File

@@ -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()
#----------------------------------------------------------------------------