X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8082483b70e7d357f72ff61c484cb2aaf424f9c4..33b44316a8c2924a07eb63b892eb48b3e73a7781:/wxPython/demo/run.py diff --git a/wxPython/demo/run.py b/wxPython/demo/run.py index c62889b057..82d702bb43 100755 --- a/wxPython/demo/run.py +++ b/wxPython/demo/run.py @@ -18,7 +18,7 @@ on the command line. """ -import sys +import sys, os from wxPython.wx import * #---------------------------------------------------------------------------- @@ -33,7 +33,8 @@ class RunDemoApp(wxApp): def __init__(self, name, module): self.name = name self.demoModule = module - wxApp.__init__(self, 0) + wxApp.__init__(self, 0) ##wxPlatform == "__WXMAC__") + def OnInit(self): wxInitAllImageHandlers() @@ -60,9 +61,9 @@ class RunDemoApp(wxApp): # otherwise the demo made its own frame, so just put a # button in this one if hasattr(frame, 'otherWin'): - wxButton(frame, 1101, " Exit ") + b = wxButton(frame, -1, " Exit ") frame.SetSize((200, 100)) - EVT_BUTTON(frame, 1101, self.OnButton) + EVT_BUTTON(frame, b.GetId(), self.OnButton) else: # It was probably a dialog or something that is already # gone, so we're done. @@ -71,6 +72,8 @@ class RunDemoApp(wxApp): self.SetTopWindow(frame) self.frame = frame + #wxLog_SetActiveTarget(wxLogStderr()) + #wxLog_SetTraceMask(wxTraceMessages) return true @@ -81,7 +84,7 @@ class RunDemoApp(wxApp): def main(argv): - if len(argv) != 2: + if len(argv) < 2: print "Please specify a demo module name on the command-line" raise SystemExit