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.