]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/run.py
Added generic LoadObject methods that can load any classtype from a
[wxWidgets.git] / wxPython / demo / run.py
index c62889b0570f409b80903d6a3c9dd92ebcb07400..82d702bb4325c443fc75d13012b3ab0881dd42c7 100755 (executable)
@@ -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