-Q2.B.5- add new actions to an existing binding?
From: -II- Tk Questions and Answers - How can I:
A2.B.5. The question was actually:
>I want to bind a text window so that any keypress in that window
>updates the window's title bar. This is what I used:
>
> text .textWin ...
> bind .textWin <Any-KeyPress> {+wm title . "Nextedit - edited"}
>
>This is supposed to let the user know that the text in the window
>has been edited. The problem is the "+". Where does it go? Ive
>tried a bunch of things and it always ends up with either parse
>errors or the wm command completely overrides the binding and does
>not allow any text entry. I need to add the new binding to the
>current ones so that a keypress enters the text *and* updates the
>titlebar. How?
>
gwl@cpu.com (Gerald W. Lester) replied:
You need to move the class specific binding down to the widget specific
binding. Try this:
bind .textWin <Any-KeyPress> Text
bind .textWin <Any-KeyPress> {+wm title . "Nextedit - edited"}
Parent document is top of "FAQ: comp.lang.tcl Tk Toolkit Usage Questions And Answers (1/1)"
Previous document is "-Q2.B.4- get root's mouse bindings to work in my Tk application?"
Next document is "-Q2.C.1- get an application to also use libXt?"