Chapter 8. Events

Table of Contents

bindtags
Bind
Abridged Chapter
Events inside of Windows

Tcl/Tk features an elaborated event handling model. A series of event handler sets is automatically assigned to a window. The assigned sets can be regrouped and extended with new sets.


In Example 8.1, “Event Handler Sets”, the current window path name is ».t« and its class is »Sample«. The »all« set is something like a rest event handler. The window ».t« is a »toplevel« window, hence only three event handler sets are present. Every non-toplevel window underneath .t will feature ».t« as an event handler set, just before »all«.

Jeszra only maintains the window related event handler set. Such as ».t« for the toplevel window. Other event handler sets are better written inside a editor and bound to the window using the »bindtags« command. The »Events« page in the Inspector can be used to create event handlers for a given event and to assign it to the window set.