Version 3 of bindtags

Updated 2002-04-30 15:41:07

bindtags {window} ?tagList?

http://www.purl.org/tcl/home/man/tcl8.4/TkCmd/bindtags.htm

man page

Used to define the binding hierarchy for Widgets. See A tiny input manager for a usage example.

RS gave a great description of bindtags: he called them "bundles of bindings" or something to that effect. Widgets have a list of such "bundles" associated with them. Every time an event happens over that widget, each "bundle" is checked in turn, and if there is a binding matching the event, it is fired. If the binding does a break no more "bundles" are considered. Otherwise, each additional bundle goes through the same processing in turn.

Examples

By default, each widget has a set of bindtags that includes the specific widget, the widget class, the toplevel window for that widget, and the special word "all". So, for example, to attach a binding to all widgets you can associate the binding with the tag "all" rather than a specific widget.


Tk syntax help | Arts and crafts of Tcl-Tk programming | Category Command