[wxPython-users] Adding Validation to wx.TextEntryDialog
Robin Dunn
robin at alldunn.com
Mon Jun 18 12:55:20 PDT 2007
David A. Barrett wrote:
> Is there any way to add a validator to a wx.TextEntryDialog?
> I tried using SetValidator() in the __init__ of a class inheriting
> from wx.TextEntryDialog, but my Validate() method didn't seem
> to get called on the OK press. I'll contrive and post a code
> example is the answer to my question should be "yes."
You need to attach the validator to the text ctrl. It's not documented
but it looks like it is always created with an ID of 3000, so you can
get a reference to the textctrl with:
txtctrl = dlg.FindWindowById(3000)
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list