How to bind to a tag in Tkinter

  • Thread starter Dowding George A
  • Start date
D

Dowding George A

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top