[Mac, 2.8.2] strange behavior of wxWindowBase::Validate()
Robin Dunn
robin at alldunn.com
Mon Jul 16 09:33:56 PDT 2007
Yaron Tadmor wrote:
> Hi,
>
> Looking at the code of wxWindowBase::Validate(), I noticed something
> strange.
>
> The Validator of "this" is never used. Only the validators of the
> children. And then a recursion occurs as needed.
>
> This seems very strange.
It is how it is documented to work, and AFAIK it has always been this
way. Validate is intended to be called on a container window with child
controls. In such a case the container is valid only if all of its
controls are valid, so it doesn't need its own validator.
>
> Say I have a window and a control hierarchy. I would call Validate() of
> the whole window to validate the whole content, but I would also like to
> take one control and call its Validate() method to validate only that
> control. As things are now, I can't do that since the control's
> validator is never used.
theControl->GetValidator()->Validate(theControl)
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wx-users
mailing list