[wxPython-users] PyValidator and floats, howto?

Robin Dunn robin at alldunn.com
Sat Jan 20 15:22:48 PST 2007


Basil Shubin wrote:
> Hi friends!
> 
> I have trying understand this *damn* PyValidator and don't know how I 
> can check text while input, so only float number will be accepted... Why 
> there Validator method that do not do anything?
> 
> Inside OnChar method I can only check if inputed *char* is valid, but 
> don't know how to validate entire string.

In the validator methods you can get the window it is attached to with 
self.GetWindow(), then you can get the current value with 
window.GetValue() or whatever the specific window class uses.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list