Skip to content

Commit 526695f

Browse files
committed
Try setting size for graph input boxes as a workaround for wx bug
1 parent d6be77d commit 526695f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

gui/utils/inputs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ def _validateWithReason(self, value):
5858
class FloatBox(wx.TextCtrl):
5959

6060
def __init__(self, parent, value, id=wx.ID_ANY, style=0, validator=None, **kwargs):
61+
# Workaround for #2591
62+
if 'wxMac' in wx.PlatformInfo and 'size' not in kwargs:
63+
kwargs['size'] = wx.Size(97, 26)
6164
super().__init__(parent=parent, id=id, style=style, **kwargs)
6265
self.Bind(wx.EVT_TEXT, self.OnText)
6366
self._storedValue = ''
@@ -107,6 +110,9 @@ def GetValueFloat(self):
107110
class FloatRangeBox(wx.TextCtrl):
108111

109112
def __init__(self, parent, value, id=wx.ID_ANY, style=0, **kwargs):
113+
# Workaround for #2591
114+
if 'wxMac' in wx.PlatformInfo and 'size' not in kwargs:
115+
kwargs['size'] = wx.Size(97, 26)
110116
super().__init__(parent=parent, id=id, style=style, **kwargs)
111117
self.Bind(wx.EVT_TEXT, self.OnText)
112118
self._storedValue = ''

0 commit comments

Comments
 (0)