- bindtags window ?tagList?
Uppercase entry: Here is a little example that diverts lowercase letter keys to their uppercase variants (other characters come through unharmed) - for the "; break" bit I had to quote the binding body, instead of listifying it as one normally should:
Prettify this chat conversation:vr: WRT bindtags, can you explain how to preserve the original code bound to that event using bindtags?vr: also, why should I be binding to the buttonrelease event?suchenwi: Simply: if you have custom bindings, bind them to a bindtag, not a widget name; place that bindtag (with the bindtags command) in the binding sequence of the widget(s) in question.suchenwi: eval bindtags $myWidget myBindings [bindtags $mywidget]suchenwi: puts everything that you bind to myBindings before all other bindings of myWidget (but they are still executed, if yours doesn't break)
"... KHIM is a good example. Any widget that wants KHIM's services can add 'khim' to its list of bindtags, and get a whole lot of <Key> bindings ... What you do to get KHIM to apply to a text widget is to say,
In March, 2006 an article on bindtags appears on tclscripting.com [1]
foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
bind Upcase $i "event generate %W [string toupper $i]; break"
} ;# RS
# Usage example, associate the bindtags to a widget:
pack [entry .e]
bindtags .e [concat Upcase [bindtags .e]]Prettify this chat conversation:vr: WRT bindtags, can you explain how to preserve the original code bound to that event using bindtags?vr: also, why should I be binding to the buttonrelease event?suchenwi: Simply: if you have custom bindings, bind them to a bindtag, not a widget name; place that bindtag (with the bindtags command) in the binding sequence of the widget(s) in question.suchenwi: eval bindtags $myWidget myBindings [bindtags $mywidget]suchenwi: puts everything that you bind to myBindings before all other bindings of myWidget (but they are still executed, if yours doesn't break)
"... KHIM is a good example. Any widget that wants KHIM's services can add 'khim' to its list of bindtags, and get a whole lot of <Key> bindings ... What you do to get KHIM to apply to a text widget is to say,
bindtags $text [linsert [bindtags $text] 1 khim]... which will change the bindtags from {.text Text . all} to {.text khim Text . all}"
In March, 2006 an article on bindtags appears on tclscripting.com [1]
