Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Christian Gollwitzer Newsgroups: comp.lang.python Subject: Re: Tkinter GUI Error Date: Tue, 14 Jan 2014 22:33:23 +0100 Organization: A noiseless patient Spider Lines: 16 Message-ID: References: <1ab2aa93-1ba6-48b0-a5f4-5fb05cb523d1@googlegroups.com> <3f7e442e-b86d-45c9-bd70-52c6abcca549@googlegroups.com> <95e61d6c-5626-4d29-9dda-98e1bcb38546@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 14 Jan 2014 21:33:32 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="cf24b1b95dd2a112e7d46d2fb5d5f72b"; logging-data="4537"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HBX6wVuhzaVRNqknQMxt7qyqIE89mSWI=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <95e61d6c-5626-4d29-9dda-98e1bcb38546@googlegroups.com> Cancel-Lock: sha1:19ZX0BA0+LPCIx2YcTYFCp19Nzw= Xref: csiph.com comp.lang.python:63947 Am 14.01.14 22:27, schrieb Lewis Wood: > Also anyone know how to create an entry box for Tkinter where you can only enter in 2 digits? > You must use a validator to achieve this. This is a more advanced topic though. A validator is a function that is called whenever the user keys something in - even by copy/pasting - and has to decide, whether this change is accepted or not. It is relatively easy to annoy your users if the validator is not written carefully. For instance, you must always accept th eempty string, otherwise the users won't be able to delete everything - very annoying behaviour. See for example this SO question http://stackoverflow.com/questions/4140437/python-tkinter-interactively-validating-entry-widget-content Christian