HPlogo Using the X Window System > Chapter 5 Application Resources

How Applications Obtain Attributes

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

An application can get attributes from several different places:

  • Resources directly loaded into an application's resource database:

    • Command-line options.

    • .Xdefaults file.

    • Resources loaded into the RESOURCE_MANAGER property.

    • Application resource files (for example, app-defaults files or .rc files).

  • Other sources:

    • Defaults built into the client.

    • Environment variables.

    • Inter-client communications.

The following list shows how applications obtain resources. A resource at the top of the list overrides the same resource found further down the list. For instance, a resource in .Xdefaults overrides the same resource in the app-defaults directory.

  • Command-line options. These options are good for only that one instance of the application. A command-line option is the equivalent of a client.resource statement in a resource file.

  • A host environment:

    • If an XENVIRONMENT variable exists, it may contain the name of a file that specifies application attributes.

    • A $HOME/.Xdefaults-host file may contain resources to be used for a specific remote host. It is read only if no XENVIRONMENT variable exists.

  • Personal resources:

    • Loaded into the RESOURCE_MANAGER property.

    • .Xdefaults (or sys.Xdefaults) file.

  • User-specific files for particular classes of applications:

    • If an XUSERFILESEARCHPATH variable exists, it may specify a directory of files containing application class defaults for the specific user.

    • If XUSERFILESEARCHPATH variable does not exist, and if an XAPPLRESDIR variable exists, it may specify a directory of files containing user-specific application class defaults.

    • $HOME/app-class files may contain application resources. These files are read only if XUSERFILESEARCHPATH and ``XAPPLRESDIR do not exist.

    For information about these variables, refer to Programming with the Xt Intrinsics.

  • Application-specific configuration files in the app-defaults subdirectory of /usr/lib/X11. Each file specifies attributes for a particular class of application. An app-defaults file is the equivalent of a Class*resource statement in a resource file. (The environment variable XFILESEARCHPATH may define a language-dependent location of app-defaults.)

  • Internal defaults built into the application.

© 1995 Hewlett-Packard Development Company, L.P.