| Bindings |
|
|
Bindings are the name given to connections between events and event handlers. For example, because of a binding an entry widget has an event handler ready to handle a character when an appropriate keyboard event happens. This binding is established by default when an entry widget is created. Tk's default bindings will serve most of your purposes but most scripts seem to require that a few additional bindings be created. Tcl supports I/O and timer events as discussed above in
The Event Loop.
The Tk programmer may not have a need for these things. But the Tk
programmer does need to work with user and user-related events because
they initiate actions by Tk's widgets. A Bindings arrange for scripts called event handlers to be triggered, that is, to go on an event queue, when a particular kind of event happens. Tk executes the event handlers on the event queue, one by one, when it can. Unlike Tcl, Tk is always event-driven. Event-driven programming may cause timing problems. Some solutions are discussed in the last section of this chapter. If those aren't sufficient, you should read The Event Loop and More about the Event Loop above very carefully.
|
Author's Home Page |
|
Order from Amazon. |