On Friday, 31 August 2012, Dennis Lee Bieber wrote: > On Fri, 31 Aug 2012 15:41:01 GMT, Alister > <alister.w...@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
-- http://mail.python.org/mailman/listinfo/python-list