]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/ToggleButton.py
Fix "warning: operation on 'y' may be undefined".
[wxWidgets.git] / wxPython / demo / ToggleButton.py
index 43a7d0a370394cf9dc2a4d866665f03f50084616..f03dd7f4b77c5564fd8a58853158c5c72f756d48 100644 (file)
@@ -2,10 +2,7 @@
 import  wx
 
 haveToggleBtn = 1
 import  wx
 
 haveToggleBtn = 1
-
-try:
-    wx.ToggleButton
-except NameError:
+if wx.Platform == "__WXX11__":
     haveToggleBtn = 0
 
 #----------------------------------------------------------------------
     haveToggleBtn = 0
 
 #----------------------------------------------------------------------
@@ -37,10 +34,10 @@ def runTest(frame, nb, log):
         win = TestPanel(nb, log)
         return win
     else:
         win = TestPanel(nb, log)
         return win
     else:
-        dlg = wx.MessageDialog(frame, 'wx.ToggleButton is not available on this platform.',
-                          'Sorry', wx.OK | wx.ICON_INFORMATION)
-        dlg.ShowModal()
-        dlg.Destroy()
+        from Main import MessagePanel
+        win = MessagePanel(nb, 'wx.ToggleButton is not available on this platform.',
+                           'Sorry', wx.ICON_WARNING)
+        return win
 
 
 #----------------------------------------------------------------------
 
 
 #----------------------------------------------------------------------
@@ -60,4 +57,4 @@ This class is only available under wxMSW and wxGTK currently.
 if __name__ == '__main__':
     import sys,os
     import run
 if __name__ == '__main__':
     import sys,os
     import run
-    run.main(['', os.path.basename(sys.argv[0])])
+    run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])