How to bind to a tag in Tkinter

Dowding George A gdowdin at cs.clemson.edu
Mon Jun 7 19:42:47 CEST 2004


Brent B. Welch gives this example in _Practical Programming in Tcl and Tk_.

bindtags $t [list ViInsert Text $t all]
bind ViInsert <Escape> {bindtags %W {ViCmd %W all}}
bind ViCmd <Key-i> {bindtags %W {ViInsert Text %W all}}

I want to do something along those lines.  Tkinter provides a
bindtags method for each widget, but I can't figure out how to bind to
a tag of my creation.  Tkinter provides widget.bind,
widget.bind_class(), and widget.bind_all(), but from what I can tell
there is no way to bind to a tag as the Tcl/Tk example indicates that
I should be able to do.

What I want to do is add my own tag to the front of the taglist for
each widget in a Tkinter application and bind events to that tag so I
can record a sequence of events.

Hopefully this makes sence.

-- 
http://www.cs.clemson.edu/~gdowdin
George A. Dowding, Clemson University Computer Science Dept.
G023 Jordan Hall



More information about the Python-list mailing list