[Tkinter-discuss] Tkinter-discuss Digest, Vol 30, Issue 4

Jeff Cagle jrcagle at juno.com
Sun Aug 20 18:42:02 CEST 2006


I got this reply from Cameron Laird and thought it would be worth 
passing on.  Thanks to all for their input on this and the other question.

On Sun, Aug 20, 2006 at 01:31:51AM -0400, Jeff Cagle wrote:
			.
			.
			.

>> I would like to be able to cap the size of an entry so that the user can 
>> only type a max of n characters.   In practice, it may not matter, but 
>> it seems like good programming practice to have a cap on input buffers.  :-) 
>> 
>> Is there any way to do such a thing?
>  
>
			.
			.
			.
Yes.

You can use PMW; an example would be

    Pmw.EntryField(validate = {'max': 13})

Alternatively, you can write you own validatecommand for the Entry.

Also, it might interest you that an Entry *can* be multi-line, with
built-in wrapping.







More information about the Tkinter-discuss mailing list