Setting X Resources with the Resource Helper

Introduction to the Resource Helper

With Resource Helper, you can customize the key definitions and the colors of the SAS interactive interface. Resource Helper creates SAS resource definitions and stores them in a location where the Resource Manager can find them. See How the Resource Helper Searches for X Resources for a list of the locations that Resource Helper searches for resource definitions. Resource settings that are saved with Resource Helper will take effect the next time you start a SAS session.
You can start Resource Helper from within a SAS session or from your shell prompt.

How to Start the Resource Helper

Start the Resource Helper from a SAS Session

Start the SAS Resource Helper from a SAS window by entering the following command on the command line in the command window:
reshelper
Main Window for Resource Helper
Main Window for Resource Helper

Start the Resource Helper from a Shell Prompt

Resource Helper is installed in the /utilities/bin subdirectory in the directory where SAS is installed (!SASROOT). The name of the executable module is reshelper. For example, if SAS is installed in /usr/local/sas93, you start Resource Helper by typing the following command:
/usr/local/sas93/utilities/bin/reshelper &

Defining Keys with the Resource Helper

How to Define a Key

To define a key, follow these steps:
  1. Start the Resource Helper (see How to Start the Resource Helper) and select the Keys icon.
    Keys Window for Resource Helper
    Keys Window for Resource Helper
    Key definitions are divided into several Action Categories:
    • Move By Cursor
    • Move By Field
    • Edit
    • Miscellaneous
    • All Actions
  2. Select Click here and press the keys you want to define.
  3. Press the key or combination of keys that you want to assign an action to. For example, press F12. If a default SAS translation has already been assigned to the key combination, Resource Helper displays the default translation.
  4. Select the action category menu button to open a list of action categories. Select the action category that you want. For example, if you want to define a key to delete the current field, select Edit as your Action Category. Resource Helper will display a list of actions in that category.
  5. Select an action from the list. For example, Delete current field. Resource Helper can assign only one action to a translation. If the action that you select requires an argument (such as sas-action-routine), Resource Helper prompts you for the argument.
    Resource Helper displays the key combination and its new definition:
    None<Key>F12: sas-delete()
    Note: If you select the sas-action-routine sas-function-key action routine, then the key definition is automatically displayed in the Keys window. If you choose another action routine and if you want the definition to appear in the Keys window, you will need to define a window label for the key. See Syntax of the SAS.keysWindowLabels Resource for information about defining labels in the Keys window.
  6. Select the right arrow to add this key translation to the list of User-Defined Keys.
  7. Click OK to exit the Keys window after you have finished defining key translations.
  8. To save your translations permanently, from the Resource Helper drop-down menus, select Filethen selectSave Resources.
To modify a key definition that is already in the User-Defined Keys list, select the definition, select the left arrow to remove the definition from the list, and edit the definition.
To delete a definition from User-Defined Keys, select it and click Delete.
Clear clears the key definition edit window.
Default Defined Keys displays the default key definitions for your system.

Troubleshooting Incorrect Key Definitions

In most cases, using Resource Helper is much easier and faster than defining the resources yourself. However, the X Window System searches for resources in several places, so it is possible for Resource Helper to pick up the wrong key symbol for the key you are trying to define. If you get unexpected results while using Resource Helper, you might need to define your key resources yourself. For more information, see Defining Key Translations.

Modifying the Color of a SAS Window Using the Resource Helper

How to Use the Color Window

You can modify the color of part of a SAS window as follows:
  1. Start Resource Helper and select the Colors icon.
    Colors Window for Resource Helper
    Colors Window for Resource Helper
  2. Select a category from the Category area.
  3. Click a color or attribute in the Colors and Attributes window, or double-click a color to open the Customize Colors area, shown in the following display.
    You can also change the attributes of some categories of SAS windows. The attributes options are HIGHLIGHT, UNDERLINE, or REVERSE.
    Customize Colors Window for Resource Helper
    Customize Colors Window for Resource Helper
    You can customize a color by doing the following:
    • selecting a new Alias
    • moving the Red, Blue, or Green sliders
    • selecting Grab and clicking a color anywhere on your screen
  4. Click OK to exit the Customize Colors window after you have finished defining your color settings.
The result is displayed in the Sample Window. The hexadecimal value of the color is displayed at the bottom of the window.

Example: Change the Color of a SAS Window

The following example shows how to change the color of a SAS window.
  1. Double-click Red in the Customize Colors window.
    The From: display shows the red currently used by the SAS windowing environment.
  2. Click Aquamarine under Aliases and observe the change in the To: display.
  3. Move the Red, Green, and Blue sliders with your mouse and note the changes in the color of the To: display.
  4. Click Apply and note the difference in the color displayed as Red in the Colors area.
  5. Click OK to save your changes.

Return to the Default Settings

Click Defaults to restore your color settings to their default values.

Permanently Save Your Color Settings

To save your color settings permanently, from the Resource Helper drop-down menus, select Filethen selectSave Resources.

How the Resource Helper Searches for X Resources

The following list describes the locations where the Resource Helper searches for resource definitions and the order in which it searches these locations.
  1. Resource Helper loads the resources in the file pointed to by the XENVIRONMENT environment variable. If XENVIRONMENT is not set, Resource Helper loads the resources in the ~/.Xdefaults-hostname file, where hostname is the name of the server on which Resource Helper is running.
  2. Resource Helper loads the resources defined in the RESOURCE_MANAGER property. If the RESOURCE_MANAGER property is the first location in which Resource Helper finds resources, the RESOURCE_MANAGER property will override any resources that you generate with Resource Helper.
    To determine whether any resources have been defined in your RESOURCE_MANAGER property, issue the following command:
    xrdb -q | more
    If no listing is returned, the RESOURCE_MANAGER property does not exist. In this case, Resource Helper loads the resources defined in the ~/.Xdefaults file.
  3. Resource Helper loads the resources in the file pointed to by the XUSERFILESEARCHPATH environment variable.
    You can use %N to substitute an application class name for a file when specifying the XUSERFILESEARCHPATH environment variable. For example, to point to /usr/local/resources as the location of all the resources for any application, issue the following command in the Bourne or Korn shells:
    export XUSERFILESEARCHPATH=\
    /usr/local/resources/%N
    In the C shell, the command is the following:
    setenv XUSERFILESEARCHPATH \
    /usr/local/resources/%N
    As a result, when SAS is invoked, the file pointed to by XUSERFILESEARCHPATH is the following:
    /usr/local/resources/SAS
    SAS is the application class name for SAS.
  4. Resource Helper loads the resources in the file specified by the XAPPLRESDIR environment variable. The application's class name is appended to the XAPPLRESDIR environment variable and the resulting string is used to search for resources. For example, you can issue the following command in the Bourne or Korn shells:
    export XAPPLRESDIR=/usr/local/app-defaults
    If you do this, then at the next invocation of SAS, the application's class name is appended to the path:
    /usr/local/app-defaults/SAS
    In the C shell, the command is the following:
    setenv XAPPLRESDIR /usr/local/app-defaults
  5. Resource Helper loads the resources in the file named ~/SAS.
  6. Resource Helper loads the resources in the file or substitution specified by the XFILESEARCHPATH environment variable.
    Note: To determine whether an environment variable has been set, you can issue the following command:
    env|grep <environment_variable>
  7. Resource Helper loads the resources defined in /usr/lib/X11/app-defaults. Resource Helper does not need to have Write access to this file, but it must be able to read the file and add the SAS resources to a resource file that has Write access. Resource Helper does not generate a warning message if the file is not present or if it cannot read the file.
  8. Resource Helper loads the fallback resources that are defined in the SAS code.
Except for the /usr/lib/X11/app-defaults file, Resource Helper tries to write the new resources to the same directory and file where it first found SAS resources. This location must be a file that has Write access and a directory that has Write access. If Resource Helper cannot write to the file, the SAS resources in that file remain in effect and any new or modified resources generated by Resource Helper will not take effect. If this situation happens, Resource Helper displays an error dialog box that contains the file or directory and suggests a way to fix the problem.