From 929343bc736ca103cf2fc0cfee1166d6b414cd88 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 25 Oct 2018 14:06:09 -0700 Subject: [PATCH] The Joystick class is available on Mac now, but we need to check if one is present. --- demo/Joystick.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/demo/Joystick.py b/demo/Joystick.py index e5ff4b5a..aa19a4ad 100644 --- a/demo/Joystick.py +++ b/demo/Joystick.py @@ -17,9 +17,6 @@ import math import wx import wx.adv -haveJoystick = True -if wx.Platform == "__WXMAC__": - haveJoystick = False #---------------------------------------------------------------------------- @@ -950,12 +947,12 @@ class JoystickDemoPanel(wx.Panel): #---------------------------------------------------------------------------- def runTest(frame, nb, log): - if haveJoystick: + if wx.adv.Joystick.GetNumberJoysticks() != 0: win = JoystickDemoPanel(nb, log) return win else: from wx.lib.msgpanel import MessagePanel - win = MessagePanel(nb, 'wx.Joystick is not available on this platform.', + win = MessagePanel(nb, 'No joysticks are found on this system.', 'Sorry', wx.ICON_WARNING) return win