Specifications
Athena Widget Set libXaw 1.0.7
of applications named xman. (Note that while typically twowidgets that
are siblings will have different names, it is not prohibited.)
Xman.Form.Command This will match anyCommand widget that is a child of a Form widget
that is itself a child of an application of class Xman.
Xman.Form.button1 This is a mixed resource name with both widget names and classes speci-
fied.
This syntax allows an application programmer to specify anywidget in the widget tree. To match
more than one widget (for example a user may want to makeall Command buttons blue), use an
asterisk (*) instead of a period. When an asterisk is used, anynumber of widgets (including zero)
may exist between the twowidget names. For example:
Xman*Command This matches all Command widgets in the Xman application.
Foo*button1 This matches anywidget in the Foo application that is named button1.
The root of all application widget trees is the widget returned by XtAppInitialize.Eventhough
this is actually an ApplicationShell widget, the toolkit replaces its widget class with the class
name of the application. The name of this widget is either the name used to invoke the applica-
tion (argv[0])orthe name of the application specified using the standard -name command line
option supported by the Intrinsics.
The last step in constructing the resource name is to append the name of the resource with either a
period or asterisk to the full or partial widget name already constructed.
*foreground:Blue Specifies that all widgets in all applications will have a fore-
ground color of blue.
Xman*borderWidth:10 Specifies that all widgets in an application whose class is
Xman will have a border width of 10 (pixels).
xman.form.button1.label:Testing Specifies that a particular widget in the xman application
will have a label named Testing.
An exclamation point (!) in the first column of a line indicates that the rest of the line should be
treated as a comment.
Final Words
The Resource manager is a powerful tool that can be used very effectively to customize X Toolkit
applications at run time by either the application programmer or the user.Some final points to
note:
•Anapplication programmer may add newresources to their application. These resources
are associated with the global application, and not anyparticular widget. The X Toolkit
function used for adding the application resources is XtGetApplicationResources.
•Becareful when creating resource files. Since widgets will ignore resources that theydo
not understand, anyspelling errors will cause a resource to have noeffect.
•Only one resource line will match anygiv e nresource. There is a set of precedence rules,
which takethe following general stance.
•More specific overrides less specific, thus period always overrides asterisk.
•Names on the left are more specific and override names on the right.
•When resource specifications are exactly the same, user defaults
will override program defaults.
Foracomplete explanation of the rules of precedence, and other specific topics see XToolkit
Intrinsics — C Language Interface and Xlib — C Language X Interface.
15