Compaq AA-PWCBD-TE Computer Accessories User Manual


 
DEC Text Processing Utility Program Development
5.2 Programming in DECwindows DECTPU
5.2.4.4 Internally Defined DECTPU Callback Routines with Widgets Not Defined by UIL
Although the SET (WIDGET) built-in procedure lets you specify values for
various resources of a widget, there are restrictions on specifying values for
callback resources of widgets. When a widget is not part of an X Resource
Manager hierarchy, specify the names of the callback resources in the array
you pass to SET (WIDGET), and specify 0 as the value of each such callback
resource. DECTPU automatically substitutes its common callback entry point for
the 0 value. A widget calls back only for those reasons specified in the widget’s
argument list. If a reason is omitted from the list, the corresponding event does
not cause a callback.
5.2.4.5 Application-Level Callback Action Routines
When DECTPU receives a widget callback, it identifies and executes the
layered application procedure or learn sequence that has been designated as
the callback action routine. You can designate a procedure or learn sequence
as a callback action routine either when the widget is created, by using the
CREATE_WIDGET built-in procedure, or at some later time, by using the SET
(WIDGET_CALLBACK) built-in procedure. When you specify an application-level
callback program or learn sequence with CREATE_WIDGET or SET (WIDGET_
CALLBACK), all widgets in the same X Resource Manager hierarchy have the
same callback program or learn sequence. Therefore, the callback program or
learn sequence must have a mechanism for handling all possible callback reasons.
5.2.4.6 Callable Interface-Level Callback Routines
If you are layering an application on DECTPU or on EVE, you can specify callable
interface-level callback routines only if you are specifying a widget’s callback
resources in a User Interface Language (UIL) file.
Callbacks can pass values known as closures. Closures are strings or integers
whose function depends on the application you are writing. (DECwindows
documentation refers to closures as tags.) For more information about what
closures are and how to use them, see Section 5.2.5.
You use the DECTPU callable interface routine TPU$WIDGET_INTEGER_
CALLBACK as the callback routine for all callbacks that have an integer closure.
You use the DECTPU routine TPU$WIDGET_STRING_CALLBACK for all
callbacks that have a string closure.
When a widget is part of an X Resource Manager hierarchy, do not include
callback resource names or values in the array you pass to SET (WIDGET).
Instead, specify the callback routine in the UIL file. When a widget is not part
of an X Resource Manager hierarchy, specify the names of the callback resources
in the array you pass to SET (WIDGET), and specify 0 as the value of each such
callback resource. DECTPU automatically substitutes its common callback entry
point for the 0 value. A widget calls back only for those reasons specified in the
widget’s argument list. If a reason is omitted from the list, the corresponding
event does not cause a callback.
DEC Text Processing Utility Program Development 5–9