O'Reilly logo

Practical Programming in Tcl & Tk, Third Edition by Brent B. Welch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The bind Command

The bind command creates event bindings, and it returns information about current bindings. The general form of the command is:

bind bindingTag ?eventSequence? ?command?

If all arguments are present, a binding from eventSequence to command is defined for bindingTag. The bindingTag is typically a widget class name (e.g., Button) or a widget instance name (e.g., .buttons.foo). Binding tags are described in more detail later. Called with a single argument, a binding tag, bind returns the events for which there are command bindings:

bind Menubutton
=> <Key-Return> <Key-space> <ButtonRelease-1>
						<B1-Motion> <Motion> <Button-1> <Leave> <Enter>
					

The events in this example are keystroke and mouse events. <Button-1> is the event generated ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required