chiark / gitweb /
Fixes #1 issue
authorFerdi van der Werf <efcm@vdwerf.eu>
Sun, 8 Apr 2012 20:30:49 +0000 (22:30 +0200)
committerFerdi van der Werf <efcm@vdwerf.eu>
Sun, 8 Apr 2012 20:30:49 +0000 (22:30 +0200)
Moving enter and leave window event to label, fixes the bug on osx that
didn't show tooltips.

Cura/gui/configBase.py

index 9d28af4f643533643d60f6726b5fc3a103c6b09f..871e4ad9f672d9ff7d2a31892091ab807384d9e9 100644 (file)
@@ -1,7 +1,7 @@
 from __future__ import absolute_import
 import __init__
 
-import wx, os, sys, platform, types
+import wx, wx.lib.stattext, os, sys, platform, types
 
 from gui import validators
 from util import profile
@@ -109,8 +109,11 @@ class SettingRow():
                self.configName = configName
                self.panel = panel
                self.type = type
-               
-               self.label = wx.StaticText(panel, -1, label)
+
+               self.label = wx.lib.stattext.GenStaticText(panel, -1, label)
+               self.label.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnter)
+               self.label.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseExit)
+
                getSettingFunc = profile.getPreference
                if self.type == 'profile':
                        getSettingFunc = profile.getProfileSetting
@@ -129,13 +132,6 @@ class SettingRow():
                sizer.Add(self.ctrl, (x,y+1), flag=wx.ALIGN_BOTTOM|wx.EXPAND)
                sizer.SetRows(x+1)
                
-               if os.name == 'darwin':
-                       self.ctrl.Bind(wx.EVT_SET_FOCUS, self.OnMouseEnter)
-                       self.ctrl.Bind(wx.EVT_KILL_FOCUS, self.OnMouseExit)
-               else:
-                       self.ctrl.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnter)
-                       self.ctrl.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseExit)
-               
                self.defaultBGColour = self.ctrl.GetBackgroundColour()
                
                panel.main.settingControlList.append(self)