Two issues:
-
If I paste non-numeric text, such as “max” using the context menu Paste, the non-numeric text is inserted. I think this is incorrect behavior, but worse an exception is raised, as follows:
Traceback (most recent call last):
File “C:\Programs\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\lib\intctrl.py”, line 474, in OnText
value = self.GetValue()
File “C:\Programs\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\lib\intctrl.py”, line 490, in GetValue
return self._fromGUI( wx.TextCtrl.GetValue(self) )
File “C:\Programs\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\lib\intctrl.py”, line 782, in _fromGUI
return long( value )
ValueError: invalid literal for long() with base 10: ‘0max’ -
If I cut or delete the control’s value using the context menu Cut or Delete, an empty string value is left in the control. This is an error because the IntCtrl option allow_none is False.
To reproduce, run the wxPython Demo from the command line and launch the IntCtrl demo. Now perform the operations enumerated above.
Some quick debugging shows that the “overridden” methods Cut() and Paste() are not called, but I’m thinking the original author expected them to be.
This seems like an issue to me. Anyone care to confirm if this is bug? Any suggestions for a work around?
Environment:
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Windows XP
wxPython 2.8.12.1