chiark / gitweb /
Made the help popups show on focus for MacOS. This is not a perfect solution, as...
authordaid <daid303@gmail.com>
Thu, 15 Mar 2012 16:27:37 +0000 (17:27 +0100)
committerdaid <daid303@gmail.com>
Thu, 15 Mar 2012 16:27:37 +0000 (17:27 +0100)
But atleast it shows the help for MacOS now.

SkeinPyPy_NewUI/newui/configBase.py

index 7c9ec2a1be2c5a4ef394b5f4cfbb01b2f3f8f0c7..aa028e5256e4fa64101c234beeaddeb44b8f76a3 100644 (file)
@@ -65,8 +65,12 @@ class configWindowBase(wx.Frame):
                                self.popup.text.SetLabel(setting.helpText)
                        self.popup.text.Wrap(350)
                        self.popup.Fit()
-                       x, y = setting.ctrl.ClientToScreenXY(0, 0)
-                       sx, sy = setting.ctrl.GetSizeTuple()
+                       if os.name == 'darwin':
+                               x, y = self.ClientToScreenXY(0, 0)
+                               sx, sy = self.GetClientSizeTuple()
+                       else:
+                               x, y = setting.ctrl.ClientToScreenXY(0, 0)
+                               sx, sy = setting.ctrl.GetSizeTuple()
                        #if platform.system() == "Windows":
                        #       for some reason, under windows, the popup is relative to the main window... in some cases. (Wierd ass bug)
                        #       wx, wy = self.ClientToScreenXY(0, 0)
@@ -126,8 +130,12 @@ class SettingRow():
                sizer.Add(self.ctrl, (x,y+1), flag=wx.ALIGN_BOTTOM|wx.EXPAND)
                sizer.SetRows(x+1)
                
-               self.ctrl.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnter)
-               self.ctrl.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseExit)
+               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()