RE: [wxPython] curious validator behavior / [wxPython] wxValidato r Problems

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: [wxPython] curious validator behavior / [wxPython] wxValidato r Problems

Cavanaugh, Craig
I just tried your little trick also.  It solved the problem, but yes, it
does not seem to be the best solution.

Craig

> -----Original Message-----
> From: [hidden email] [SMTP:[hidden email]]
> Sent: Friday, January 07, 2000 4:54 PM
> To: wxPython Mailing List
> Subject: [wxPython] curious validator behavior
>
>
> I'm trying to get dialog boxes working in wxpython (2.1.11).
> I've got them up and happy, and I can add contents to them.
> I can even add text entry fields to them (which is what I want to do).
> I cannot, however, add text entry fields with validators (subclassed
> from wxPyValidator).  The validating fields work just fine if I put
> them in a canvas or if I put a wxPanel inside the wxDialog and put the
> validating fields inside the wxPanel.
> This strikes me as being pretty strange and is either a bug
> or a symptom of me really not understanding something.
>
> Any ideas?  I'm at least satisfied to have something that works (the
> wxPanel workaround), but the solution is not particularly elegant.
>
> -greg
>
>
> ----
> Greg Landrum, Ph.D.              [hidden email]
> Sr. Research Scientist      Dupont Pharmaceutical Research Lab
>   These are my views, not necessarily those of my employer.
>
> _______________________________________________
> wxPython-users maillist  -  [hidden email]
> http://starship.python.net/mailman/listinfo/wxpython-users

_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] curious validator behavior / [wxPython] wxValidator Problems

Robin Dunn
> > I'm trying to get dialog boxes working in wxpython (2.1.11).
> > I've got them up and happy, and I can add contents to them.
> > I can even add text entry fields to them (which is what I want to do).
> > I cannot, however, add text entry fields with validators (subclassed
> > from wxPyValidator).  The validating fields work just fine if I put
> > them in a canvas or if I put a wxPanel inside the wxDialog and put the
> > validating fields inside the wxPanel.
> > This strikes me as being pretty strange and is either a bug
> > or a symptom of me really not understanding something.
> >
> > Any ideas?  I'm at least satisfied to have something that works (the
> > wxPanel workaround), but the solution is not particularly elegant.
> >

As I've just discovered using Craig's sample, the Validators need to have
TransferToWindow and TransferFromWindow (even if all they do is return true)
in order to be used on a wxDialog.  The defaults for these methods return
false which is why the warning message pops up and also has something to do
with the GPF, (although I can't duplicate it anymore for some reason!?!)

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users