12.07.2015 Views

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

Athena Widget Set - C Language Interface - X Consortium ... - X.Org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Using <strong>Widget</strong>seither the name used to invoke the application (argv[0]) or the name of the applicationspecified using the standard -name command line option supported by theIntrinsics.The last step in constructing the resource name is to append the name of the resourcewith either a period or asterisk to the full or partial widget name alreadyconstructed.*foreground:BlueXman*borderWidth:10Specifies that all widgets in all applications will havea foreground color of blue.Specifies that all widgets in an application whoseclass is Xman will have a border width of 10 (pixels).xman.form.button1.label:Testing Specifies that a particular widget in the xman applicationwill have a label named Testing.An exclamation point (!) in the first column of a line indicates that the rest of theline should be treated as a comment.Final WordsThe Resource manager is a powerful tool that can be used very effectively to customizeX Toolkit applications at run time by either the application programmer orthe user. Some final points to note:• An application programmer may add new resources to their application. Theseresources are associated with the global application, and not any particular widget.The X Toolkit function used for adding the application resources is XtGetApplicationResources.• Be careful when creating resource files. Since widgets will ignore resources thatthey do not understand, any spelling errors will cause a resource to have no effect.• Only one resource line will match any given resource. There is a set of precedencerules, which take the 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 overrideprogram defaults.For a complete explanation of the rules of precedence, and other specific topics seeX Toolkit Intrinsics - C <strong>Language</strong> <strong>Interface</strong> and Xlib - C <strong>Language</strong> <strong>Interface</strong>.Creating Argument ListsTo set up an argument list for the inline specification of widget attributes, you mayuse any of the four approaches discussed in this section. Each resource name hasa global symbol associated with it. This global symbol has the form XtNresourcename. For example, the symbol for ``foreground'' is XtNforeground. For furtherinformation, see the X Toolkit Intrinsics - C <strong>Language</strong> <strong>Interface</strong>.Argument are specified by using the following structure:18

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!