|
|
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_name: resource_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.
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: