This program defines widget creation functions for the Tree and Panner widgets and registers the routines with Mrm.
The program also defines the pan() callback routine for the Panner widget. This routine is specified for the
XtNreportCallback, as we'll show you shortly.
27.1.2 Widget Include Files
It usually makes sense to place the declarations for a user−defined widget in an include file so that they can be used in
more than one module. The include file for the Tree widget is shown in the source code
/* UIL declarations for the Xaw Tree widget. */
! Declare the creation procedure
procedure
XawCreateTreeWidget();
! Declare resources
value
XtNautoReconfigure : argument ('autoReconfigure', boolean);
XtNhSpace : argument ('hSpace', integer);
XtNlineWidth : argument ('lineWidth', integer);
XtNvSpace : argument ('vSpace', integer);
XtNgravity : argument ('gravity', integer);
NorthGravity : 2;
WestGravity : 4;
EastGravity : 6;
SouthGravity : 8;
! Constraint resources
XtNtreeGC : argument ('treeGC', any);
XtNtreeParent : argument ('treeParent', widget);
The Tree creation procedure is declared in a procedure section, even though the application registers a widget
creation procedure differently from a callback procedure. Creation procedures should be declared as taking no
arguments.
The resources for the Tree widget are defined using the UIL argument type. The syntax is the same as for any other
value, although argument values cannot be imported or exported. The argument literal specifies the ...