Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/09/2010, 16:47
Nano-rosario
 
Fecha de Ingreso: abril-2008
Mensajes: 68
Antigüedad: 16 años, 1 mes
Puntos: 0
wx.lib.masked

Hola a todos, estoy teniendo un error usando la libreria wx.lib.masked y la verdad no tengo idea que pueda ser:

tengo la siguiente clase:

Código:
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)
la uso asi:

Código:
cant = Numeric_float(self)
el error que me da es al ejecutar:
Código:
Traceback (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
y al ingresar un caracter
Código:
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
... necesito usar un textctrl que permita solo float positivos...


Saludos