PLCOpenEditor.py
changeset 1533 aca8f43483e9
parent 1492 14ce1a631f44
child 1560 4ce8492159ab
--- a/PLCOpenEditor.py	Mon Sep 12 16:49:24 2016 +0300
+++ b/PLCOpenEditor.py	Tue Sep 13 21:42:11 2016 +0300
@@ -60,7 +60,11 @@
 
     # Create wxApp (Need to create App before internationalization because of
     # Windows)
-    app = wx.PySimpleApp()
+    if wx.VERSION >= (3, 0, 0):
+        app = wx.App()
+    else:
+        app = wx.PySimpleApp()
+
 
     from util.misc import InstallLocalRessources
     InstallLocalRessources(beremiz_dir)
@@ -160,6 +164,7 @@
     #  @param fileOpen The filepath to open if no controler defined (default: None).
     #  @param debug The filepath to open if no controler defined (default: False).
     def __init__(self, parent, fileOpen = None):
+        self.icon = wx.Icon(os.path.join(beremiz_dir, "images", "poe.ico"), wx.BITMAP_TYPE_ICO)
         IDEFrame.__init__(self, parent)
 
         result = None
@@ -178,7 +183,7 @@
                 self._Refresh(PROJECTTREE, POUINSTANCEVARIABLESPANEL, LIBRARYTREE)
 
         # Define PLCOpenEditor icon
-        self.SetIcon(wx.Icon(os.path.join(beremiz_dir, "images", "poe.ico"),wx.BITMAP_TYPE_ICO))
+        self.SetIcon(self.icon)
 
         self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
 
@@ -472,7 +477,8 @@
     sys.excepthook = handle_exception
 
 if __name__ == '__main__':
-    wx.InitAllImageHandlers()
+    if wx.VERSION < (3, 0, 0):
+        wx.InitAllImageHandlers()
 
     # Install a exception handle for bug reports
     AddExceptHook(os.getcwd(),__version__)