Next | Prev | Up | Top | Contents | Index

Callbacks

Widgets must respond to user-initiated actions. For example, when a button is clicked it changes appearance to look pressed in. Some actions have Tcl code attached to them to make something else happen when an action occurs. This code is attached to a "callback" by a widget creation command. For example, a push button triggers an activateCallback when the user presses and releases the left mouse button inside the widget; it triggers an armCallback when the user presses the mouse button, and a disarmCallback when the user releases the mouse button inside the widget.

Tcl code is attached to a callback by giving it as the second argument to the appropriate widget method. For example,

$btn      armCallback {puts "Stop squashing me!!"}
$btn   disarmCallback {puts "Ah... that's better"}
$btn activateCallback {puts "Sorry Dave"; exit 0}
This section documents Tm callback names and the actions that trigger them. Names of callbacks available for a particular widget are derived from the resource documentation for Motif. Each callback name ends with the "Callback" string. Drop the XmN from the Motif description to derive the widget command. Callbacks are treated differently from other resources because the Xt treats them differently--the resource is not meant to be handled directly by any ordinary application.


Callback Substitution
Callback Cross References

Next | Prev | Up | Top | Contents | Index