ANN: Thinking in Tkinter

Joseph A. Knapka jknapka at
Sat Sep 7 00:45:30 EDT 2002

Stephen Ferg wrote:
> A small page devoted to "Thinking in Tkinter"
> at
> for whoever might find it useful.

It's an interesting and useful site, IMO. I have one nit
to pick: you probably shouldn't refer to the parent/child
relationship between UI elements as "binding", since
that will cause great confusion when you get around
to discussing the binding of events to code (using
the widget.bind() method).

Also, you should be aware of the "command" option,
which can be applied to button widgets of various

def pushed(event):
  print "Someone pushed the button."
btn = Button(text="Push me", command=pushed)

will bind a left-click on btn to the pushed() function,
without the bother of an explicit btn.bind() call.


-- Joe
  "I'd rather chew my leg off than maintain Java code, which
   sucks, 'cause I have a lot of Java code to maintain and
   the leg surgery is starting to get expensive." - Me

More information about the Python-list mailing list