add python-wxgtk3.0 support to Beremiz_service.py
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 07 Dec 2016 17:51:20 +0300
changeset 1590 cdf95900d44f
parent 1589 a5fd07db1db6
child 1591 38e5f8847a45
add python-wxgtk3.0 support to Beremiz_service.py
Beremiz_service.py
--- a/Beremiz_service.py	Fri Dec 02 17:48:26 2016 +0300
+++ b/Beremiz_service.py	Wed Dec 07 17:51:20 2016 +0300
@@ -115,7 +115,7 @@
 if enablewx:
     try:
         import wxversion
-        wxversion.select('2.8')
+        wxversion.select(['2.8', '3.0'])
         import wx
         havewx = True
     except:
@@ -126,7 +126,12 @@
         import re
         from threading import Thread, currentThread
         from types import *
-        app=wx.App(redirect=False)
+
+        if wx.VERSION >= (3, 0, 0):
+            app = wx.App(redirect=False)
+        else:
+            app = wx.PySimpleApp(redirect=False)
+        app.SetTopWindow(wx.Frame(None, -1))
 
         # Import module for internationalization
         import gettext