ANN: Thinking in Tkinter

Steve Holden sholden at holdenweb.com
Mon Sep 9 15:59:08 EDT 2002


"Stephen Ferg" <steve at ferg.org> wrote in message
news:b16e4ef7.0209090552.3ad7691b at posting.google.com...
> > you'd better include a clear warning...
> > that you'll explain how to do it correctly
> > later...
>
> Can you say a little more?  What is it that makes using "bind()"
> incorrect?   And what is it about using "command" that avoids the
> problems?
>
> This is a genuine request for information, not a challenge to your
> statement.  I am still learning about Tkinter features.

The problem, from a learner's point of view, is that most Tkinter widgets
need to be bound to a number of different events. Consider, for example, how
the default button in an interface is triggered by an Enter keystroke.

The command option is specifically provided to allow the programmer to hook
their code in whenever any relevant bound event triggers that widget in the
interface.

Consequently, which bind() is a valuable technique for Tkinter programmers
to know about, it's rather like teaching someone to drive by explaining the
mechanical details of the steering and engine.

regards
-----------------------------------------------------------------------
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Previous .sig file retired to                    www.homeforoldsigs.com
-----------------------------------------------------------------------






More information about the Python-list mailing list