Hello List,
long time no see…
I am porting an old, large wxPython application to Python 3 and to Phoenix, and I am having a hell of a time with masked controls. Starting to hate them to be honest.
This piece of code:
import wx
import wx.lib.masked as masked
app = wx.App(0)
frame = wx.Frame(None, -1, 'Test Masked')
panel = wx.Panel(frame)
ctrl = masked.NumCtrl(panel, -1, 1.0, pos=(10, 10))
ctrl.SetParameters(min=0.0, max=10.0, integerWidth=2, fractionWidth=2, limited=True,
allowNone=False, autoSize=False)
frame.Show()
app.MainLoop()
Breaks for me with this:
C:\Users\J0514162\MyProjects\PY3_PORT\Installation>python test_masked.py
Traceback (most recent call last):
File "C:\Users\J0514162\MyProjects\PY3_PORT\Installation\test_masked.py", line 9, in <module>
ctrl.SetParameters(min=0.0, max=10.0, integerWidth=2, fractionWidth=2, limited=True,
File "C:\Users\J0514162\WinPython39\WPy64-39100\python-3.9.10.amd64\lib\site-packages\wx\lib\masked\numctrl.py", line 913, in SetParameters
if self.IsLimited() and self._min is not None and value < self._min:
TypeError: '<' not supported between instances of 'NoneType' and 'float'
And it doesn’t appear to matter what I pass as an input to that wicked control. This is on Windows 10 64 bit, Python 3.9.10 64 bit, wxPython Phoenix 4.2.0 msw (phoenix) wxWidgets 3.2.0.
Suggestions most welcome .
Thank you in advance.
Andrea.