tengo la siguiente clase:
Código:
la uso asi:from wx.lib import masked
class Numeric_float(masked.NumCtrl):
def __init__(self, parent):
masked.NumCtrl.__init__(self,parent,value=10, integerWidth=2, allowNegative=False)
Código:
el error que me da es al ejecutar:cant = Numeric_float(self)
Código:
y al ingresar un caracterTraceback (most recent call last):
File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 14618, in <lambda>
lambda event: event.callable(*event.args, **event.kw) )
File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\lib\masked\numctrl.py", line 1173, in _CheckInsertionPoint
if sel_to < self._fields[0]._extent[1] and text[sel_to] in (' ', '-', '('):
IndexError: string index out of range
Código:
... necesito usar un textctrl que permita solo float positivos...Traceback (most recent call last):
File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\lib\masked\maskededit.py", line 3066, in _OnChar
if keep_processing and self._isCharAllowed( char, pos, checkRegex = True ):
File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\lib\masked\maskededit.py", line 4717, in _isCharAllowed
newvalue, ignore, ignore, ignore, ignore = self._insertKey(char, at, sel_start, sel_to, value, allowAutoSelect=True)
File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\lib\masked\maskededit.py", line 5119, in _insertKey
if fstr[0] in erasable_chars or (self._signOk and field._index == 0 and fstr[0] in ('-','(')):
IndexError: string index out of range
Saludos


