Consultor Eletrônico



Kbase 12888: How PROGRESS Version 7 for OSF/Motif will load X resources
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
How PROGRESS Version 7 for OSF/Motif will load X resources

DRAFT COPY - Currently under review and edit.

INTRODUCTION:
=============
The OSF/Motif implementation of PROGRESS Version 7 allows you to
customize several X resources. This document will explain how
PROGRESS accesses these resources and how to verify that they have
been loaded correctly.

WHY YOU NEED TO KNOW THIS:
===========================
X Windows users are accustomed to making changes to an application's
look and feel by changing X resource settings. Usually this involves
creating a file that contains the resource settings you desire, then
loading the file to the X server where the application will run.
The X server then honors the requested settings as the rules of X and
the native window manager allow.

PROCEDURAL APPROACH:
====================

Starting PROGRESS on the Host Console
-------------------------------------

The presentation of an application's look and feel is carried out by a
process called an X server. Any device that runs X Windows -- whether
it is a workstation, X terminal, or PC X emulation package -- does so
by means of an X server.

When you start an X process such as Motif PROGRESS, the X server on
your display device will automatically attempt to read a series of
resource files. Resources specified in each subsequent file in the
series will override conflicting specifications in a previous file.

The various files are accessed in the following order:

(1) The first resource file read by the X server is the global file,
named "Progress".

Each X application should have its own global X resource file
stored in the X "app-defaults" directory. The "app-defaults"
directory on an X Windows host is typically found within the
directory of X libraries. For instance, if the X libraries on
your system reside in /usr/lib/X11, then the "app-defaults"
directory might be: /usr/lib/X11/app-defaults

The global X resource file for PROGRESS is simply called
"Progress". Therefore, the global resource settings for all users
on your host might be in: /usr/lib/X11/app-defaults/Progress

You are better off not making changes to this file to suit your
personal needs, since this is the global resource file accessed
by all users of PROGRESS on this particular host. To implement
personal X Windows settings for PROGRESS, use one of the other
resource files described below. If none of these files exists
in your home directory, you can create it by copying the global
resource file to a new file named using the conventions given.

(2) The next place that PROGRESS looks for X resources is in a file
named "Progress" that resides in your *home* directory. For
example, if your home directory is /usr/home/melgibson, then you
could optionally store PROGRESS X resources in a file called:
/usr/home/melgibson/Progress

Again, due to the way X Windows treats the series of resource
files as a hierarcy, the settings in the "Progress" file in your
home directory will override any conflicting settings in the
global resource file.

(3) The next place PROGRESS will look for X resource settings is in a
file in your home directory named .Xdefaults-<hostname>. For
example, if you are logged into a host system named "carnivore",
PROGRESS will look for: /usr/home/melgibson/.Xdefaults-carnivore

(4) PROGRESS then looks for a file named .Xdefaults, without any
hostname appended. For example: /usr/home/melgibson/.Xdefaults

(5) Next, PROGRESS will look at the X resources that you might have
loaded using the "xrdb" command. The most commonly used syntax
for loading resources using "xrdb" is: xrdb -merge <resourcefile>

Note that the <resourcefile> in this instance can be anything.
It can be any of the files mentioned earlier, or some other file
named as you choose. The important point to remember about
"xrdb" is that it forces a resource load to the server.


Starting PROGRESS on a Remote X Server
--------------------------------------
You make use of a *remote* X server any time you log onto a host
without using the host console. Examples of remote X servers are X
terminals, PC X emulation software, or even other workstations on your
network.

When using X servers that are remote from the target host, you can
encounter difficulty in accessing the X resource files automatically.
This is because the remote server may not have the direct access to
host files that the automatic process requires.

To get around this, many remote X server products have built-in means
for allowing you to "force" a load of X resources. These techniques
vary from product to product, so to learn more about them you should
consult the manufacturer's documentation.

Aside from using the manufacturer's method for loading X resources,
you can assure a resource load to the remote X server by using the
"xrdb" command described above. The advantages to using "xrdb" are
twofold: you don't have to learn the customized method for each X
server product that you happen to own, and you can place the "xrdb"
command into one of the scripts that executes automatically when you
log onto the host.

(1) How do I know I'm on a remote X server?

The easiest way to tell is, if your $DISPLAY variable is set to point
to any device *other* than your host once you have logged in, then
you are probably running on a "remote" server. Any PC X software
product (such as Reflection X, Hummingbird, or PC-Xware) is a remote
X server. Any X terminal (even one capable of running local clients)
is a remote X server. Another workstation on your network may also
qualify as a "remote" X server if it has problems accessing the files
on the host you're logging into.

You can check the $DISPLAY variable setting on your server by
executing the command "echo $DISPLAY" at the UNIX prompt. On most
networks, the $DISPLAY variable setting for a device consists of the
device's network hostname with ":0" appended to the end. For example,
if you are running on an X terminal named NCD-3, then the $DISPLAY
variable setting for your terminal is NCD-3:0.

(2) How do I guarantee X resources will load to my X server?

Again, use "xrdb". If you have placed X resource settings in a file
called .Xdefaults in your home directory, load these resources using
the command: xrdb -merge /usr/home/melgibson/.Xdefaults

(3) How do I confirm that X resources have loaded properly?

The "xrdb" command has a "-query" option that allows you to look at
every resource setting you've loaded to your server. Since the output
of this command can be lengthy, pipe it, as in: xrdb -query | more

Upon executing this command, look for Progress resources in the
paged output and verify their settings.


TROUBLESHOOTING
===============
If you believe you've made proper changes to PROGRESS X resources but
do not see them taking effect, check for the following:

(1) Did you name the resources correctly? See the PROGRESS Version 7
System Administration Guide for a listing of available resources
and their proper naming conventions.

(2) Did you spell the resources correctly? X Windows does *not*
generate error messages in response to incorrect resource
specifications. Resources are also case-sensitive, so make sure you
check for proper case as well.

(3) Is your $DISPLAY variable set correctly before loading the X
resources? Use "echo $DISPLAY" to see.

(4) Is your display allowing other devices to connect to it? Use
the command "xhost +" to enable all hosts on your network to connect
to your display. Use "xhost" (without the added "+" to verify the
current status of access control.

(5) Did you restart PROGRESS before expecting to see the effects of
the resource change take place? Like most X applications, PROGRESS
will read only those X resources that are set at startup. If you
make changes to X resource files while PROGRESS is running, then you
must reload the resource file(s) using "xrdb" *and* restart PROGRESS
to see them take effect.


ONLINE PROCEDURES OR UTILITIES:
===============================
The on-line manual entry for "xrdb" contains information on how to use
the command to load and query X resources.


REFERENCES TO WRITTEN DOCUMENTATION:
====================================
For more information on how X resources are named and read into an X
server, obtain Volume 3, "X Window System User's Guide," in the X
Window System documentation series published by O'Reilly and
Associates. The entire O'Reilly series can be obtained from any
commerical software vendor.

Progress Software Technical Support Note # 12888