]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/Joystick.py
better __docfilter__ and other epydoc tweaks
[wxWidgets.git] / wxPython / demo / Joystick.py
index f3bdcd7b338caa2a50a8e982a74dfdb727e59c27..219dbd139f0d59ba01c37308cd7f9cf16466ec21 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()
+    
 
 #----------------------------------------------------------------------------
 
@@ -1070,4 +1083,4 @@ needed, then re-start the timer, possibly using wx.CallAfter().
 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:])