[Tkinter-discuss] Entry widget max size

Cameron Laird Cameron at phaseit.net
Sun Aug 20 18:28:24 CEST 2006


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