X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d1679124ae303fb78561ee2b0c56b5831fd0fafe..00fd036c18e0fbc369e6855cf48c5bc942459563:/wxPython/demo/wxToggleButton.py

diff --git a/wxPython/demo/wxToggleButton.py b/wxPython/demo/wxToggleButton.py
index 80f1cf1c04..b184437ab7 100644
--- a/wxPython/demo/wxToggleButton.py
+++ b/wxPython/demo/wxToggleButton.py
@@ -1,6 +1,12 @@
 
 from wxPython.wx import *
 
+haveToggleBtn = 1
+try:
+    wxToggleButton
+except NameError:
+    haveToggleBtn = 0
+
 #----------------------------------------------------------------------
 
 class TestPanel(wxPanel):
@@ -25,8 +31,16 @@ class TestPanel(wxPanel):
 #----------------------------------------------------------------------
 
 def runTest(frame, nb, log):
-    win = TestPanel(nb, log)
-    return win
+    if haveToggleBtn:
+        win = TestPanel(nb, log)
+        return win
+    else:
+        dlg = wxMessageDialog(frame, 'wxToggleButton is not available on this platform.',
+                          'Sorry', wxOK | wxICON_INFORMATION)
+        dlg.ShowModal()
+        dlg.Destroy()
+
+
 
 
 #----------------------------------------------------------------------