[Tutor] Query about using Pmw entry widget...

Luke Paireepinart rabidpoobear at gmail.com
Sun Jan 7 15:45:40 CET 2007


Asrarahmed Kadri wrote:
> Hello Folks,
>  
> I am using Pmw mdoule to develop a User interface and in that I am 
> using entry widget.
>  
> Can some one help me how to add validation : only integers are allowed 
> and minimum value should be 1.
>  
> timeInterval = Pmw.EntryField(label_text='Time Interval(in 
> sec.):',labelpos='w',validate = 'numeric')
>  
> Also I want to validate date and time? I know that there is a way to 
> do it but I dont know the exact syntax..
Asrarahmed -
 From what I remember (PMW is just an extension of TKinter so this 
should apply here)
it's a lot easier to validate the input when you're using it instead of 
trying to restrict their input.
I.E. when they hit 'submit' give them a little warning saying 'sorry, 
you can't submit unless you have an integer in field "fieldname" .....'
That's most likely the easiest way to do this.
If you just google for tkinter validate entry  you should come up with 
the other way, IIRC (where they can't input incorrect values).
HTH,
-Luke.
>
> -- 
> To HIM you shall return.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>   



More information about the Tutor mailing list