Beremiz_service.py
branchwxPython4
changeset 3307 eeec6e0ea269
parent 3282 725d3e9ac913
child 3426 c2c366964913
--- a/Beremiz_service.py	Sun Sep 05 05:43:17 2021 +0200
+++ b/Beremiz_service.py	Sun Sep 05 15:24:14 2021 +0200
@@ -224,6 +224,7 @@
 
     if havewx:
         import re
+        import wx.adv
 
         if wx.VERSION >= (3, 0, 0):
             app = wx.App(redirect=False)
@@ -265,7 +266,7 @@
             def SetTests(self, tests):
                 self.Tests = tests
 
-        class BeremizTaskBarIcon(wx.TaskBarIcon):
+        class BeremizTaskBarIcon(wx.adv.TaskBarIcon):
             TBMENU_START = wx.NewId()
             TBMENU_STOP = wx.NewId()
             TBMENU_CHANGE_NAME = wx.NewId()
@@ -277,7 +278,7 @@
             TBMENU_QUIT = wx.NewId()
 
             def __init__(self, pyroserver):
-                wx.TaskBarIcon.__init__(self)
+                wx.adv.TaskBarIcon.__init__(self)
                 self.pyroserver = pyroserver
                 # Set the image
                 self.UpdateIcon(None)
@@ -325,7 +326,7 @@
                 elif "wxGTK" in wx.PlatformInfo:
                     img = img.Scale(22, 22)
                 # wxMac can be any size upto 128x128, so leave the source img alone....
-                icon = wx.IconFromBitmap(img.ConvertToBitmap())
+                icon = wx.Icon(img.ConvertToBitmap())
                 return icon
 
             def OnTaskBarStartPLC(self, evt):