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" on page 66 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

Starting the Resource Helper From a SAS Session

Start the SAS Resource Helper from a SAS window by entering

 reshelper 

on the command line in the command window.

click to expand
Display 3.2: Main Window for Resource Helper

Starting the Resource Helper From a Shell Prompt

Resource Helper is installed into 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/sas91 , you start Resource Helper by typing the following command:

 /usr/local/sas91/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" on page 62) and select the Keys icon.

    click to expand
    Display 3.3: 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-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" on page 76 for information on defining labels in the KEYS window.

  6. Select the right arrow to add this key translation to the list of User-Defined Keys .

  7. Select OK to exit the Keys window after you have finished defining key translations.

  8. To save your translations permanently, from the Resource Helper pull-down menus , select
    File Save 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 select 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. See "Defining Key Translations" on page 74 for more information.

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.

    click to expand
    Display 3.4: Colors Window for Resource Helper

  2. Select a category from the Category window.

  3. Click a color and/or attribute in the Colors and Attributes window, or double-click a color to open the Customize Colors window, 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 .

    click to expand
    Display 3.5: Customize Colors Window for Resource Helper

    You can customize a color by

    • selecting a new Alias

    • moving the Red, Blue, or Green sliders

    • selecting Grab and clicking a color anywhere on your screen.

  4. Select OK to exit the Colors window after you have finished defining your color settings.

The result is displayed in the Sample Window . The hex value of the color is displayed at the bottom of the window.

Example: Changing the Color of a SAS Window

For example, double-click Red in the Colors window. The From: display shows the red currently used by SAS windowing environment. Click Aquamarine under Aliases and observe the change in the To: display. Move the Red , Green , and Blue sliders with your mouse button and note the changes in the color of the To: display. Click Apply and note the difference in the color displayed as Red in the Colors window. Select OK to save your changes.

Returning to the Default Settings

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

Permanently Saving Your Color Settings

To save your color settings permanently, from the Resource Helper pull-down menus, select
File Save 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 machine 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 if 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

     setenv XUSERFILESEARCHPATH \   /usr/local/resources/%N 

    As a result, when SAS is invoked, the file pointed to by XUSERFILESEARCHPATH is

     /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, if you issue the following command in the Bourne or Korn shells:

     export XAPPLRESDIR=/usr/local/app-defaults 

    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

     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 if an environment variable has been set, you can issue the following command:

     envgrep <  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 writable resource file. 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 writable file in a writable directory. If Resource Helper cannot write to the file, the SAS resources in that file will remain in effect and any new or modified resources generated by Resource Helper will not take effect. If this happens, Resource Helper displays an error dialog box that contains the file or directory and suggests a way to fix the problem.




SAS 9.1 Companion for UNIX Environments
SAS 9.1 Companion For Unix Enivronments
ISBN: 1590472101
EAN: 2147483647
Year: 2004
Pages: 185
Authors: SAS Institute

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net