]> git.saurik.com Git - wxWidgets.git/commitdiff
Can't use NameError to check for NotIMplemented anymore. Just
authorRobin Dunn <robin@alldunn.com>
Mon, 23 Feb 2004 21:23:26 +0000 (21:23 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 23 Feb 2004 21:23:26 +0000 (21:23 +0000)
explicitly check platforms until I figure out a better way to do it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/Joystick.py
wxPython/demo/PopupWindow.py
wxPython/demo/ToggleButton.py

index f3bdcd7b338caa2a50a8e982a74dfdb727e59c27..857ec2d83b8e4d9b0c251f675e26a42cb3d85ef7 100644 (file)
@@ -5,7 +5,7 @@
 # Author:      Jeff Grimmett (grimmtoo@softhome.net), adapted from original
 #              .wdr-derived demo
 #
-# Created:     01/02/04
+# Created:     02-Jan-2004
 # RCS-ID:      $Id$
 # Copyright:
 # Licence:     wxWindows license
 import  math
 import  wx
 
+haveJoystick = True
+if wx.Platform == "__WXMAC__":
+    haveJoystick = False
+
 #----------------------------------------------------------------------------
 
 # Once all supported versions of Python support 32-bit integers on all
@@ -963,8 +967,17 @@ class JoystickDemoPanel(wx.Panel):
 #----------------------------------------------------------------------------
 
 def runTest(frame, nb, log):
-    win = JoystickDemoPanel(nb, log)
-    return win
+    if haveJoystick:
+        win = JoystickDemoPanel(nb, log)
+        return win
+    else:
+        dlg = wx.MessageDialog(
+                frame, 'wx.Joystick is not available on this platform.',
+                'Sorry', wx.OK | wx.ICON_INFORMATION
+                )
+        dlg.ShowModal()
+        dlg.Destroy()
+    
 
 #----------------------------------------------------------------------------
 
index daea319286cd72793595a390e9b0e71fb2e6ff44..83d7056a6eeebe94e7f0aaa270f951c819dda845 100644 (file)
@@ -9,9 +9,7 @@
 import  wx
 
 havePopupWindow = 1
-try:
-    wx.PopupWindow
-except NameError:
+if wx.Platform == '__WXMAC__':
     havePopupWindow = 0
     wx.PopupWindow = wx.PopupTransientWindow = wx.Window
 
@@ -199,7 +197,6 @@ def runTest(frame, nb, log):
                 frame, 'wx.PopupWindow is not available on this platform.',
                 'Sorry', wx.OK | wx.ICON_INFORMATION
                 )
-
         dlg.ShowModal()
         dlg.Destroy()
 
index 43a7d0a370394cf9dc2a4d866665f03f50084616..d69b01506781a7e2ea66051df37a87a614818755 100644 (file)
@@ -2,10 +2,7 @@
 import  wx
 
 haveToggleBtn = 1
-
-try:
-    wx.ToggleButton
-except NameError:
+if wx.Platform == "__WXX11__":
     haveToggleBtn = 0
 
 #----------------------------------------------------------------------