\c{
Handlers
A note on terminology is in place here.
The reader may be a little astonished by
the fact that we have both a handler
class and a handler function,
which is more properly written
as .
The situation may even seem more confusing
when realizing that the widget
class itself is a descendant of the
handler class.
Schematically, we have the situation as depicted
in slide [h-disc].
}
\slide{h-disc}{Handler classes and functions}{
class widget : public handler {
public:
...
void handler(class handler* h) { ... }
...
};
}
\c{
Note that there is no ambiguity here.
A handler object is an object
that may be invoked in response to a Tcl command
or an event.
The handler function declares
a handler object to be responsible
for dealing with the events
that are of interest to the widget.
Note that since a widget is a handler instance,
it may declare itself as a handler for the incoming
events.
}