Tkinter bug in Entry widgets on OS X

Arnaud Delobelle arnodel at gmail.com
Sat Sep 1 05:55:15 EDT 2012


On Friday, 31 August 2012, Dennis Lee Bieber wrote:

> On Fri, 31 Aug 2012 15:41:01 GMT, Alister <alister.ware at ntlworld.com<javascript:;>
> >
> declaimed the following in gmane.comp.python.general:
>
> > I agree that it is unexpected in a single line entry box but isn't the
> 1st
> > rule of user interface design to assume the user is a moron & will do
> > things they are not supposed to do?
> >
> > Therefore invalid inputs should be handled gracefully (not just insert
> > random characters) which is what I think the original poster is
> > suggesting.
>
>         To which I'd suggest the programmer (vs the user), probably needs
> to
> code some sort of per-character validation check... After all, there may
> be situations where accepting pretty much any key-code is desired, and
> if the widget filters characters before they get to the programmer level
> that becomes impossible.
>
>
It would be good if I could intercept the key press event and cancel its
action on the Entry widget.  It's easy to intercept the key event, but I
haven't found out how to prevent the funny characters from being inserted
into the Entry widget input area.  I've struggled to find good tkinter docs
on the web.


>         caveat -- I've only written one simple form using Tkinter, so what
> do I know...


It's about as much as I've done!

-- 
Arnaud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120901/156c7819/attachment.html>


More information about the Python-list mailing list