Bug when importing Beremiz without wx.App declared fixed
authorlaurent
Mon, 19 Oct 2009 16:26:15 +0200
changeset 422 76aebe92fd5f
parent 421 c9ec111ad275
child 423 4d7ac355701d
child 431 fcd344deae84
Bug when importing Beremiz without wx.App declared fixed
Beremiz.py
--- a/Beremiz.py	Mon Oct 19 16:03:46 2009 +0200
+++ b/Beremiz.py	Mon Oct 19 16:26:15 2009 +0200
@@ -641,9 +641,9 @@
         self.RefreshScrollBars()
         self.Thaw()
 
-    normal_bt_font=wx.Font(faces["size"] / 3, wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName = faces["helv"])
-    mouseover_bt_font=wx.Font(faces["size"] / 3, wx.DEFAULT, wx.NORMAL, wx.NORMAL, underline=True, faceName = faces["helv"])
     def GenerateMethodButtonSizer(self, plugin, parent, horizontal = True):
+        normal_bt_font=wx.Font(faces["size"] / 3, wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName = faces["helv"])
+        mouseover_bt_font=wx.Font(faces["size"] / 3, wx.DEFAULT, wx.NORMAL, wx.NORMAL, underline=True, faceName = faces["helv"])
         if horizontal:
             msizer = wx.FlexGridSizer(cols=len(plugin.PluginMethods))
         else:
@@ -655,7 +655,7 @@
                 button = GenBitmapTextButton(id=id, parent=parent,
                     bitmap=wx.Bitmap(Bpath( "%s.png"%plugin_method.get("bitmap", os.path.join("images", "Unknown")))), label=label, 
                     name=label, pos=wx.DefaultPosition, style=wx.NO_BORDER)
-                button.SetFont(self.normal_bt_font)
+                button.SetFont(normal_bt_font)
                 button.SetToolTipString(plugin_method["tooltip"])
                 button.Bind(wx.EVT_BUTTON, self.GetButtonCallBackFunction(plugin, plugin_method["method"]), id=id)
                 # a fancy underline on mouseover
@@ -665,8 +665,8 @@
                         b.Refresh()
                         event.Skip()
                     return fn
-                button.Bind(wx.EVT_ENTER_WINDOW, setFontStyle(button, self.mouseover_bt_font))
-                button.Bind(wx.EVT_LEAVE_WINDOW, setFontStyle(button, self.normal_bt_font))
+                button.Bind(wx.EVT_ENTER_WINDOW, setFontStyle(button, mouseover_bt_font))
+                button.Bind(wx.EVT_LEAVE_WINDOW, setFontStyle(button, normal_bt_font))
                 #hack to force size to mini
                 if not plugin_method.get("enabled",True):
                     button.Disable()