Chapter Contents

Previous

Next
SAS Companion for UNIX Environments

Using X Resources to Customize the Motif Interface

X clients usually have characteristics that can be customized; these properties are known as X resources. For example, X resources can be used to define a font, a background color, or a window size. The resources for an application, such as SAS, are placed in a resource database.

The SAS System functions correctly without any modifications to the resource database. However, you may want to change the default behavior or appearance of the interface. There are several ways to specify your customizations. Some methods modify all SAS sessions displayed on a particular X server. Some methods affect all SAS sessions run on a particular host. Other methods affect only a single SAS session.

The following sections describe how to customize the resource database. If you need more information on X Window System clients and X resources, refer to the documentation provided by your vendor.


Specifying X Resources

A resource specification has the following format:

resource-string: value
The resource string usually contains two identifiers and a separator. The first identifier is the client or application name ( SAS), the separator is a period (.) or asterisk (*) character, and the second identifer is the name of the specific resource. The value given may be a Boolean value ( True or False), a number, or a character string, depending on the resource type.

The application name and resource name can both specify an instance value or a class value. A specification for a class applies to a larger scope than a single instance.

The following are sample resource specifications:

SAS.startSessionManager: True
SAS.maxWindowHeight: 100
SAS.awsResizePolicy: grow

Refer to your X Window System documentation for more information on resource specifications.


Customizing SAS Resources

The following list describes the methods that you can use to customize X resources.

For more information on X resources, refer to the X Window System documentation supplied by your vendor or to other books on the X Window System.


Setting X Resources through the Preferences Dialog Box

The Preferences dialog box allows you to control the settings of certain X resources. Changes made through the Preferences dialog box (with the exception of those resources on the General tab) become effective immediately, and the settings are saved in SASUSERPREFS file in your SASUSER directory. You can invoke the Preferences dialog box by issuing the DLGPREF command or by selecting

Tools
[arrow]
Options
[arrow]
Preferences

Preferences Dialog Box

[IMAGE]


General Options

Start Session manager
specifies whether you want the session manager to be started automatically when you start your SAS session. If you want to use your host editor in your SAS session, the session manager must be running. The session manager allows you to interrupt or terminate your SAS session and minimize and restore all of the windows in a SAS session. See Using the SAS Session Manager (motifxsassm)and Configuring the SAS System for Host Editor Support for more information. This check box sets the SAS.startSessionManager resource.

Startup Logo
specifies whether you want SAS to display an XPM file while your SAS session is being initialized and, if so, which file.

If you select Use Default Logo, SAS uses the default file for your site. If you select No Logo, then no file is displayed. If you select Use Custom Logo, then you can either enter the XPM filename directly in the text field or press [Select] to open the File Selection dialog box. This check box sets the SAS.startupLogo resource.

Use application workspace
confines all windows displayed by an application to a single Application Work Space. This check box sets the SAS.noAWS resource. You must exit and reopen the windows for changes to this resource to take effect.

AWS Resize Policy
controls the policy for resizing AWS windows as interior windows are added and removed. (See Workspace and Gravity in a SAS Session and Window Types.)

Grow
The AWS window will attempt to grow any time an interior window is grown or moved (to make all of its interior windows visible), but it will not shrink to remove unused areas.

Fixed
The AWS window will attempt to size itself to the size of the first interior window and will not attempt any further size changes.

This check box sets the SAS.awsResizePolicy resource.


DMS Options

Use menu access keys
activates pull-down menu mnemonics. When mnemonics are turned on, you can select menu items by typing the single, underlined letter in the item. This check box sets the SAS.usePmenuMnemonics resource.

Confirm exit
displays the Exit dialog box when you exit your SAS session. This check box sets the SAS.confirmSASExit resource.

Save settings on exit
tells SAS to issue the WSAVE ALL command when you exit your SAS session. This command saves the global settings, such as window color and window position, that are in effect for all windows that are currently open.These settings are saved in your SASUSER.PROFILE catalog. This check box sets the SAS.wsaveAllExit resource.

Use host printing
turns on host printing. This check box sets the SAS.hasXPrinter resource.

Backup Documents
allows you to specify whether you want SAS to automatically save (at the interval specified by the SAS.autoSaveInterval resource) the documents that you currently have open. This check box sets the SAS.autoSaveOn resource.

Help & Documentation Browser - Netscape Path
specifies the path name for the web browser that you want to use to view online help and the CD-ROM documentation. This field sets the SAS.helpBrowser resource.


Editing Options

Default paste buffer
defines an alias for the default SAS buffer. The following list describes the paste buffer alias names and the X buffer with which each name is associated.

XPRIMARY
X primary selection ( PRIMARY)

XSCNDARY
X secondary selection ( SECONDARY)

XCLIPBRD
X clipboard ( CLIPBOARD)

XTERM
exchange protocol used by the xterm client

XCUTn
X cut buffer where n is between 0 and 7, inclusive

This check box sets the SAS.defaultPasteBuffer resource. See Controlling Pull-down Menus for more information about cut-and-paste butters.

Automatically store selection
generates a STORE command every time you mark a region of text with the mouse. This check box sets the SAS.markPasteBuffer resource.

Cursor
controls the editing mode in SAS text editor windows. The Insert and Overtype check boxes set the SAS.insertModeOn resource to True and False, respectively.


Results Options

The items on the Results tab affect only output that is produced through the Output Delivery System (ODS). For a complete description of ODS, refer to The Complete Guide to the SAS Output Delivery System.

Create Listing
opens the ODS Listing destination, which produces monospace output. Selecting this check box is equivalent to entering the ODS LISTING SELECT ALL statement. This check box sets the SAS.resultsListing resource.

Create HTML
opens the ODS HTML destination, which produces output that is formatted in Hypertext Markup Language. Selecting this check box is equivalent to entering the ODS HTML SELECT ALL statement. This check box sets the SAS.resultsHTML resource.

Folder
specifies a destination for HTML files. Specifying a directory in this field is equivalent to specifying a directory with the PATH option in the ODS HTML statement. This field sets the SAS.resultsTmpDir resource.

Use WORK Folder
tells the ODS to send all HTML files to your WORK directory. Selecting this check box is equivalent to specifying the pathname of your WORK directory with the PATH option in the ODS HTML statement. This check box sets the SAS.resultsUseWork resource.

Style
specifies the style definition to use for HTML output. The style definition controls such aspects as color, font name, and font size. Specifying a style in this field is equivalent to specifying a style with the STYLE option in the ODS HTML statement. You can specify any style that is defined in the \ODS\PREFERENCES\STYLES key in the SAS Registry. You can open the SAS Registry by issuing the REGEDIT command or by selecting

Solutions
[arrow]
Accessories
[arrow]
Registry Editor
This field sets the SAS.resultsHTMLStyle resource.

View results as they are generated
tells SAS to automatically display results files when they are generated. If you select this check box, make sure that Password protect HTML file browsing is deselected. This check box sets the SAS.resultsAutoNavigate resource.

Password protect HTML file browsing
tells SAS to prompt you for your password before sending HTML files to your browser. If you select this check box, make sure that View results as they are generated is deselected. This check box sets the SAS.htmlUsePassword resource.


Toolbox and Command Window Options

The items in the ToolBox Window area of the Preferences dialog box affect both the toolbox and the command window.

Display tools window
determines whether to display the default toolbox. This check box sets the SAS.defaultToolBox resource.

Display command window
determines whether to display the command window. This check box sets the SAS.defaultCommandWindow resource.

Auto Complete Commands
specifies whether SAS automatically fills in the remaining letters of a command as you type a command in the command window that begins with the same letter as a command that you have entered previously. If both this check box and Save Commands are selected, then SAS can automatically fill in commands that were entered in previous sessions. This check box sets the SAS.autoComplete resource.

Save Commands
specifies whether SAS saves the commands that you enter in the command window and how many commands are saved. You can specify a number from 0 to 50. If you specify 0, no commands will be saved. If you specify 1 or more, that number of commands is saved in the file commands.hist in your SASUSER directory. If this check box is selected, then SAS will be able to automatically fill in (see Auto Complete Commands) commands that were entered in previous sessions. This field sets the SAS.commandsSaved resource.

Combine windows
combines the toolbox and command window into one window. The toolbox and command window are combined by default. This check box sets the SAS.useCommandToolBoxCombo resource.

Use arrow decorations
adds arrows to both end of the combined toolbox/command window. This check box sets the SAS.useShowHideDecorations resource.

Always on top
keeps the toolbox or the combined toolbox/command window on top of the window stack. This check box is selected by default, which may cause problems with window managers and other applications that want to be on top of the window stack. If you have such a situation, turn off this feature. This check box sets the SAS.toolBoxAlwaysOnTop resource.

Toolbox Persistent
specifies whether the toolbox that is associated with the Program Editor stays open when you close the Program Editor. By default, the Program Editor toolbox stays open whenever you close the Program Editor. If you deselect this check box, then the toolbox will close if you close the Program Editor. This check box sets the SAS.isToolBoxPersistent resource.

The items in the Tools area affect the individual tools in the toolbox.

Use large tools
controls whether tool icons are displayed as 24x24 or 48x48 pixels. The default is 24x24. This check box sets the SAS.useLargeToolBox resource.

Use tip text
specifies whether tool tip text is displayed when you position your cursor over a tool in the toolbox. Some window managers may place the toolbox tip behind the toolbox. If this happens in your environment, deselect this check box. This check box sets the SAS.useToolBoxTips resource.

delay
controls the delay in milliseconds before popping up the toolbox tip. This check box sets the SAS.toolBoxTipDelay resource. You can enter a value directly into the field or use the arrows to the right of the field to change the value.


Setting X Resources with the Resource Helper

With Resource Helper, you can customize the key definitions and colors of SAS's interactive interface. Resource Helper creates SAS resource definitions and stores them in a location where the Resource Manager can find them. See How 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.

Starting Resource Helper from a SAS Session

Start the SAS Resource Helper from a SAS window by entering

reshelper
on the command line.

Main Window for Resource Helper

[IMAGE]


Starting 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 the SAS System is installed in /usr/local/sas8, you start Resource Helper by typing the following command:

/usr/local/sas8/utilities/bin/reshelper &

If you run Resource Helper from a shell script, you might need to set the XKEYSYMDB and XLOCALEDIR environment variables in order for Resource Helper to work. XKEYSYMDB should contain the path to /X11/resource_files/XKeysymDB in the !SASROOT directory, and XLOCALEDIR should contain the path to /X11/resource_files/locale/ in that same directory. If SAS is installed in /usr/local/sas8, then in the Bourne or Korn shells, you can assign these environment variables as follows:

export XKEYSYMDB=\
/usr/local/sas8/X11/resource_files/XKeysymDB
export XLOCALEDIR=\
/usr/local/sas8/X11/resource_files/locale/
In the C shell, you can enter
setenv XKEYSYMDB \
/usr/local/sas8/X11/resource_files/XKeysymDB
setenv XLOCALEDIR \
/usr/local/sas8/X11/resource_files/locale/

Resource Helper accepts the standard X Toolkit options. Refer to the documentation provided by your X Window System vendor for a list of these options.

Changing Keys with Resource Helper

Note:    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 for more information.  [cautionend]

Start the Resource Helper (see Setting X Resources with the Resource Helper) and select the Keys icon.

Keys Window for Resource Helper

[IMAGE]

Key definitions are divided into several Action Categories:

To define a key, follow these steps:

  1. Select [Click here and press the keys you want to define].

  2. 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.

  3. 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.

  4. 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 Modifying the keysWindowLabels Resource for information on defining labels in the KEYS window.  [cautionend]

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

  6. Select [OK] to exit the Keys window after you have finished defining key translations.

  7. To save your translations permanently, from the Resource Helper pull-down menus, select

    File
    [arrow]
    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.

Changing Colors with Resource Helper

Start Resource Helper and select the Colors icon.

Colors Window for Resource Helper

[IMAGE]

You can modify the color of part of a SAS window as follows:

  1. Select a category from the Category window.

  2. Single-click on a color and/or attribute in the Colors and Attributes window, or double-click on a color to open the Customize Color window, shown in Customize Colors Window for Resource Helper.

    Customize Colors Window for Resource Helper

    [IMAGE]

    You can customize a color by

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

For example, double-click on Red in the Colors window. Change Red from: displays the Red currently used by SAS windowing environment. Click on 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 on Apply and note the difference in the color displayed as Red in the Colors window. Select [OK] to save your changes.

You can also change the attributes of some categories of SAS windows. Attributes allows you to select Highlight, Underline, or Reverse.

Select [Defaults] to restore your color settings to their default values. Select [OK] to exit the Colors window after you have finished defining your color settings. To save your color settings permanently, from the Resource Helper pull-down menus, select

File
[arrow]
Save Resources

How 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. (On RS6000 systems, you must set the XUSERFILESEARCHPATH 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 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:

    env|grep <environment_variable>
      [cautionend]

  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 trys 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.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.