DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Understanding resources

About resources

A resource is any parameter that affects a client's behavior or appearance, such as foreground colors, background colors, fonts, window size, and window placement. A resource is set through a resource specification, which contains the resource variable and a resource value. For example:

client*resource_nameresource_value

When you execute a client, it locates any resource specifications that affect it and then uses those attributes to define its appearance and behavior.

A resource is typically named for the aspect of appearance or behavior that it controls. For example, the fontList resource controls the font that is used to display text in the Graphical Environment.

In applications written with the X Toolkit (or an Xt-based toolkit such as the OSF/Motif toolkit), resources may be associated with separate widgets within an application. This allows you to control an entire class of a widget in the client, as well as control specific instances of a class. For example, you can set all of a client's buttons to display in blue, except for the Help button, which displays in red.

Thus, with resources, you can modify behavior and appearance on a general level, or a very specific level. You can specify a resource that controls only one feature of a single application or specify a resource that controls one feature of multiple objects within multiple applications.

There are several ways you can specify resources: through the resource database (using a program called xrdb), with system resource files, with resource files in your home directory, and from the command line.

A set of routines called the ``resource manager'' determines things like the order in which the various resource files are read, the syntax for resource specifications, and the rules of precedence by which conflicting or competing resource specifications are resolved.

The concepts and terminology associated with resources may seem complex at first. However, once you read this chapter and spend some time experimenting by creating your own resource specifications, you will find the task of setting resources straightforward.

See also:


Next topic: Syntax for resource specifications
Previous topic: Understanding resources

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003