Thanks. Yes, I've looked at the ObjectAttrValidator.py code
extensively. It seems to be a fairly good example of how I'd expect
Validators to work, but it doesn't have any demo code included. If it
did, many of my questions would be answered.
Thanks,
C.D.
···
On Thu, 24 Feb 2005 19:25:37 +0100, Werner F. Bruhin <werner.bruhin@free.fr> wrote:
Hi,
you might one to have a look at this:
http://wiki.wxpython.org/index.cgi/Validator_20for_20Object_20Attributes
Count Down wrote:
>Hi all,
>
>I'm trying to understand Validators in the context of wxPython. I've
>been rummaging around the web without much success. I took a look at
>the wxPython2.5 Validator demo. Here's what I found:
>
>1) A proper Validator needs to implement the Clone,
>TransferFromWindow, TransferToWindow, and Validate methods.
>
>2) The Validator demo presents a subclass of PyValidator that
>implements the Clone and Validate method, but not the other methods.
>
>
I use validator for data transfer between controls and database, so I do
use the TransferToWindow to transfer data from the database to a control
and the other way round I use the TransferFromWindow.Note that TransferToWindow is also called by InitDialog.
Hope this helps
Werner>3) The Validate method is never called by the demo. In particular,
>all the work is being done by the OnChar method which is bound to
>wx.EVT_CHAR.
>
Don't know haven't looked at it.
<snip>