Validator support for text, integer and floating-point variants

7 views
Skip to first unread message

ABC

unread,
May 26, 2019, 2:18:48 PM5/26/19
to wxPython-dev
mentions subclasses of text, integer and floating point validators, but I get a "no attribute" error when I try to use them.

Robin Dunn

unread,
May 27, 2019, 12:33:22 AM5/27/19
to wxPython-dev
On Sunday, May 26, 2019 at 11:18:48 AM UTC-7, ABC wrote:
mentions subclasses of text, integer and floating point validators, but I get a "no attribute" error when I try to use them.

They excluded on purpose, IIRC because they rely on being able to have access to C++ types in other classes by address, which is not a good fit for the Python way of doing things, and especially when dealing with wrapped C++ classes. The main purpose for using the validators in that way is for data transfer from the widget to/from the value's storage place, not just for validation.

OTOH, implementing type-specific validators in Python is super easy and so having special classes for it is not a necessity. Check in the demo for a couple examples. 

--
Robin
Reply all
Reply to author
Forward
0 new messages