Prism 6.0 User's Guide

Chapter 10 Customizing Prism

This chapter discusses ways in which you can change various aspects of Prism's appearance and the way Prism operates.

See the following sections:

Customizing Different Versions of Prism

You can customize MP Prism just as you customize scalar Prism. Both MP Prism and scalar Prism use the same .prisminit file. This could lead to error messages if you bring up scalar Prism and the file contained MP Prism-specific commands. Therefore, Prism lets you specify that commands in your .prisminit file are for MP Prism only by bracketing them with #ifdef MP and #endif. For example,

alias c cont
#ifdef MP
pset 0
alias c "cont; wait every"
#endif

These commands define c to aliases differently in scalar Prism and MP Prism, and set the initial pset to 0 in MP Prism.

To provide this feature, Prism must preprocess the .prisminit file; by default it does not do this. To tell Prism to preprocess the file, use the Prism resource Prism.cppPath, specifying the path to your C preprocessor as its setting; typically, this is /lib. Thus, you would set the resource as follows:

Prism.cppPath: /lib

See " Changing Prism Defaults" for information on setting Prism resources. Note, however, that commands-only Prism is not aware of the settings of Prism resources such as Prism.cppPath, unless the settings are contained in the system-wide Prism app-defaults file.

Using the Tear-Off Region

You can place frequently used menu selections and commands in the tear-off region below the menu bar; in the tear-off region, they become buttons that you can click on to execute functions. Figure 10-1 shows the buttons that are there by default.

Figure 10-1 The Tear-Off Region

Graphic

Putting menu selections and commands in the tear-off region lets you access them without having to pull down a menu or issue a command from the command line.

Changes you make to the tear-off region are saved when you leave Prism; see " Where Prism Stores Your Changes".

Adding Menu Selections to the Tear-Off Region

You can add menu selections to the tear-off region from either the menu bar or the command line.

Figure 10-2 Tear-Off Region Dialog Box

Graphic

While the dialog box is on the screen, choosing any selection from a menu adds a button for this selection to the tear-off region. Clicking on a button in the tear-off region removes that button. If you fill up the region, you can resize it to accommodate more buttons. To resize the region, drag the small resize box at the bottom right of the region.

Click on Close or press the Esc key while the mouse pointer is in the dialog box to close the box and leave tear-off mode.

When you are not in tear-off mode, clicking on a button in the tear-off region has the same effect as choosing the equivalent selection from a menu.

tearoff "print (events)"

adds a button for the Print selection from the Events menu to the tear-off region.

Adding Prism Commands to the Tear-Off Region

To add a Prism command to the tear-off region, issue the pushbutton command, specifying the label for the tear-off button and the command it is to execute. The label must be a single word. The command can be any valid Prism command, along with its arguments. For example,

pushbutton printa print a on dedicated

adds a button labeled printa to the tear-off region. Clicking on it executes the command print a on dedicated.

To remove a button created via the pushbutton command, you can either click on it while in tear-off mode, or issue the untearoff command as described above.

Creating Aliases for Commands and Variables

Prism provides commands that let you create alternative names for commands, variables, and expressions.

Use the alias command to set up an alternative name for a Prism command. For example,

alias ni nexti

makes ni an alias for the nexti command. Prism provides some default aliases for common commands. Issue alias with no arguments to display a list of the current aliases. Issue the unalias command to remove an alias. For example,

unalias ni

removes the alias created above.

Use the set command to set up an alternative name for a variable or expression. For example,

set alan = annoyingly_long_array_name

abbreviates the annoyingly long array name to alan. You can use this abbreviation subsequently in your program to refer to this variable. Use the unset command to remove a setting. For example,

unset alan

removes the setting created above.

Changes you make via alias and set last for your current Prism session. To make them permanent, you can add the appropriate commands to your .prisminit file; see " Initializing Prism".

Using the Customize Utility

Many aspects of Prism's behavior and appearance--for example, the colors it displays on color workstations, and the fonts it uses for text--are controlled by the settings of Prism resources. The default settings for many of these resources appear in the file Prism in the X11 app-defaults directory for your system. Your system administrator can change these system-wide defaults. You can override these defaults in two ways:

Choosing Customize from the Utilities menu displays the window shown in Figure 10-3.

Figure 10-3 Customize Window

Graphic

How to Change a Setting

On the left of the Customize window are the names of the resources. Next to each resource is a text-entry box that contains the resource's setting (if any). To the right of the fields are Help buttons. Clicking on a Help button or anywhere in the text-entry field displays help about the associated resource in the box at the top of the window.

The way you set a value for a resource differs depending on the resource:

Whenever you make a change in a text-entry box, Apply and Cancel buttons appear to the right of it. Click on Apply to save the new setting; it takes effect immediately. Click on Cancel to cancel it; the setting changes back to its previous value.

Click on Close or press the Esc key to close the Customize window.

Resources

You can customize the X Window System resources that Prism (and other X applications) uses.

The file must be in ASCII format. Each line of the file must contain three integers between 0 and 255 that specify the red, green, and blue components of a color.

The first line of the visualizer color file contains the color that is to be displayed for values that fall below the minimum you specify in creating the visualizer. The next-to-last line contains the color for values that exceed the maximum. The last line contains the color used to display the values of elements that are not in the context specified by the user in a where statement. Prism uses the colors in between to display the values falling between the minimum and the maximum. See Table 10-1 for an example.

Table 10-1 Sample Visualizer Colors

Red 

Green 

Blue 

255 

255 

255 

255 

255 

255 

255 

255 

255 

255 

255 

255 

100 

100 

100 

Like the default settings, this file specifies black for values below the minimum, white for values above the maximum, and gray for values outside the context. But the file reverses the default spectral map for other values: from lowest to highest, values are mapped red-yellow-green-cyan-blue-magenta.

Where Prism Stores Your Changes

Prism maintains a file called .prism_defaults in your home directory. In it, Prism keeps:

Do not attempt to edit this file; make all changes to it through Prism itself. If you remove this file, you get the default configuration the next time you start Prism.

Changing Prism Defaults

As mentioned in the previous section, you can change the settings of many Prism resources either by using the Customize utility or by adding them to your X resource database. This section describes how to add a Prism resource to your X resource database.

An entry is of the form

resource-name: value

where resource-name is the name of the Prism resource, and value is the setting. Table 10-2 lists the Prism resources.

Table 10-2 Prism Resources

Resource 

Use 

Prism.comm1Color

Specifies the color of the first communicator displayed in the MPI queue visualizer. 

Prism.comm2Color

Specifies the color of the second communicator displayed in the MPI queue visualizer. 

Prism.comm3Color

Specifies the color of the third communicator displayed in the MPI queue visualizer. 

Prism.commOtherColor

Specifies the color of the fourth communicator displayed in the MPI queue visualizer. 

Prism.cppPath

Specifies the path to your C preprocessor. 

Prism.dialogColor

Specifies the color for dialog boxes. 

Prism.editGeometry

Specifies the size and placement of the editor window. 

Prism.editor

Specifies the editor to use. 

Prism.errorBell

Specifies whether the error bell is to ring. 

Prism.errorwin

Specifies the window to use for error messages. 

Prism*fontList

Specifies the font for labels, menu selections, etc. 

Prism.graphBGColor

Specifies the background color of all graphics windows, such as the structure browser, Where graph, and visualizer. 

Prism.graphFillColor

Specifies the interior fill color for objects in graphics windows that have 3-D shadow borders. 

Prism.helpBrowser

Specifies the browser to use for displaying help. 

Prism.helpUseExisting

Specifies whether to use a currently running browser for displaying help. 

Prism.mainColor

Specifies the main background color for Prism. 

Prism.make

Specifies the make utility to use.

Prism.markStaleData

Specifies how Prism is to mark stale data in visualizers. 

Prism.procMenu

Specifies whether a menu is displayed when setting a breakpoint in a Fortran 90 generic procedure. 

Prism.procThresh

Changes the maximum number of specific procedures automatically shown when performing an action on a Fortran 90 generic procedure. 

Prism.spectralMapSize

Specifies the size of the default spectral color map for color visualizers. 

Prism.textBgColor

Specifies the background color for widgets containing text. 

Prism.textFont

Specifies the text font to use for certain labels. 

Prism.textManyFieldTranslations

Specifies the keyboard translations for dialog boxes that contain several text fields. 

Prism.textMasterColor

Specifies the color used to highlight the master pane in a split source window. 

Prism.textOneFieldTranslations

Specifies the keyboard translations for dialog boxes that contain one text field. 

Prism.useXterm

Specifies whether to use a new Xterm for I/O. 

Prism.vizColormap

Specifies the colors to be used in colormap visualizers. 

Prism*XmText.fontList

Specifies the text font to use for most running text. 

Note that the defaults mentioned in the sections below are the defaults for Prism as shipped; your system administrator can change these in Prism's file in your system's app-defaults directory.

Note also that commands-only Prism is not aware of the settings of any Prism resources, unless they are contained in Prism's app-defaults file. This matters only for the resource Prism.cppPath.

Adding Prism Resources to the Resource Database

The X resource database keeps track of default settings for programs running under X. Use the xrdb program to add a Prism resource to this database. An easy way to do this is to use the -merge option and to specify the resource and its setting from the standard input. For example, the following command specifies a default editor (the resource is described below):

% xrdb -merge
 Prism.editor: emacs

Type Ctrl-d to signal that there is no more input. Note that you must include the -merge option; otherwise, what you type replaces the contents of your database. The new settings take effect the next time you start Prism.

Another way to add your changes is to put them in a file, then merge the file into the database. For example, if your changes are in prism.defs, you could issue this command:

% xrdb -merge prism.defs

Consult your X documentation for more information about xrdb.

Specifying the Editor and Its Placement

Use the Prism.editor resource to specify the editor that Prism is to invoke when you choose the Edit or Email selection from the Utilities menu (or issue the corresponding commands).

Use the resource Prism.editGeometry to specify the X geometry string for the editor created by the Edit selection from the Utilities menu. The geometry string specifies the number of columns and rows, and the left and right offsets from the corner of the screen.

You can also change the settings of these resources via the Customize utility; see " Using the Customize Utility" for more information.

Specifying the Window for Error Messages

Use the Prism.errorwin resource to specify the window to which Prism is to send error messages. Predefined values are command, dedicated, and snapshot. You can also specify your own name for the window.

You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".

Changing the Text Fonts

You may need to change the fonts Prism uses if, for example, its fonts aren't available on your system. Use the resources described below to do this. To list the names of the fonts available on your system, issue the Solaris xlsfonts command. You should try to substitute a font that is about the same size as the Prism default; substituting a font that is much larger can cause display problems, since Prism does not resize windows and buttons to accommodate the larger font.

Use the Prism.textFont resource to specify the font that Prism is to use in displaying the labels of histograms and text in visualizers. By default, Prism uses a 12-point fixed-width font for this text.

You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".

Use the Prism*XmText.fontList resource to change the font used to display most of the running text in Prism, such as the source code in the source window. By default, Prism uses a 12-point fixed-width font for this text.

Use the Prism*fontList resource to change the font used for everything else (for example, menu selections, pushbuttons, and list items). By default, Prism uses a 14-point Helvetica font for this text.

Changing Colors

Prism provides several resources for changing the default colors it uses when it is run on a color workstation.

Changing the Colors Used for Colormap Visualizers

Use the Prism.vizColormap resource to specify a file that contains the colors to be used in colormap visualizers. You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility". See " Resources" for a discussion of how to create a visualizer color file.

Use the resource Prism.spectralMapSize to specify how large the default spectral color map is to be for colormap visualizers. The default is 100 entries. You would typically use this resource to specify fewer entries, if this number causes problems on your workstation. To set the default to 50, for example, set the resource in your X resource database as follows:

Prism.spectralMapSize: 50

Changing Prism's Standard Colors

Use the Prism.dialogColor resource to change the background color of dialog boxes.

Use the Prism.textBgColor resource to change the background color for text in buttons, dialog boxes, etc. Note that this setting overrides the setting of the X toolkit -bg option.

Use the Prism.textMasterColor resource to change the color used to highlight the master pane when the source window is split.

Use Prism.graphFillColor to specify the interior fill color for objects in graphics windows that have 3-D shadow borders.

Use Prism.graphBGColor to specify the background color of all graphics windows, such as the structure browser, where graph, and visualizer.

Use the Prism.mainColor resource to change the color used for just about everything else.

The defaults are:

Prism.dialogColor: Thistle
Prism.textBgColor: snow2
Prism.textMasterColor: black
Prism.graphFillColor: grey
Prism.graphBGColor: light grey
Prism.mainColor: light sea green

Changing the Colors of MPI Communicators in the MPI Queue Visualizer

Use the Prism.comm1Color resource to change the color of the first communicator displayed in the MPI queue visualizer.

Use the Prism.comm2Color resource to change the color of the second communicator displayed in the MPI queue visualizer.

Use the Prism.comm3Color resource to change the color of the third communicator displayed in the MPI queue visualizer.

Use the Prism.commOtherColor resource to change the color of the fourth communicator displayed in the MPI queue visualizer.

The defaults are:

Prism.comm1Color: chartreuse2
Prism.comm2Color: cyan2
Prism.comm3Color: magenta2
Prism.commOtherColor: purple

Changing Keyboard Translations

You can change the keys and key combinations that Prism translates into various actions. In general, doing this requires an understanding of X and Motif programming. You may be able to make some changes, however, by reading this section and studying the defaults in Prism's file in your system's app-defaults directory.

Changing Keyboard Translations in Text Widgets

Use the Prism.textOneFieldTranslations resource to change the default keyboard translations for dialog boxes that contain only one text field. Its default definition is:

Prism.textOneFieldTranslations: 
<Key>osfDelete: delete-previous-character() 
   <Key>osfBackSpace: delete-previous-character()
      Ctrl<Key>u: erase_to_beginning() 
      Ctrl<Key>k: erase_to_end() 
      Ctrl<Key>d: delete_char_at_cursor_position() 
      ctrl<Key>f: move_cursor_to_next_char() 
      Ctrl<Key>h: move_cursor_to_prev_char() 
      Ctrl<Key>b: move_cursor_to_prev_char() 
      Ctrl<Key>a: move_cursor_to_beginning_of_text()
      Ctrl<Key>e: move_cursor_to_end_of_text()

(The definitions with osf in them are special Motif keyboard symbols.)

Use the Prism.textManyFieldTranslations resource to change the default keyboard translations for dialog boxes that contain several text fields. Its default definition is:

Prism.textManyFieldTranslations:
   <Key>osfDelete: delete-previous-character() 
   <Key>osfBackSpace: delete-previous-character() 
   <Key>Return: next-tab-group() 
   <Key>KP_Enter: next-tab-group() 
     Ctrl<Key>u: erase_to_beginning() 
     Ctrl<Key>k: erase_to_end() 
     Ctrl<Key>d: delete_char_at_cursor_position() 
     Ctrl<Key>f: move_cursor_to_next_char() 
     Ctrl<Key>h: move_cursor_to_prev_char() 
     Ctrl<Key>b: move_cursor_to_prev_char() 
     Ctrl<Key>a: move_cursor_to_beginning_of_text() 
     Ctrl<Key>e: move_cursor_to_end_of_text()

If you make a change to any field in one of these resources, you must copy all the definitions.

Changing General Motif Keyboard Translations

Prism uses the standard Motif translations that define the general mappings of functions to keys. They are shown below.

*defaultVirtualBindings:
    osfActivate :    <Key>Return
    osfAddMode :     Shift <Key>F8 
    osfBackSpace :   <Key>BackSpace 
    osfBeginLine :   <Key>Home 
    osfClear :       <Key>Clear 
    osfDelete :      <Key>Delete 
    osfDown :        <Key>Down 
    osfEndLine :     <Key>End 
    osfCancel :      <Key>Escape 
    osfHelp :        <Key>F1 
    osfInsert :      <Key>Insert 
    osfLeft :        <Key>Left 
    osfMenu :        <Key>F4 
    osfMenuBar :     <Key>F10 
    osfPageDown :    <Key>Next 
    osfPageUp :      <Key>Prior 
    osfRight :       <Key>Right 
    osfSelect :      <Key>Select 
    osfUndo:         <Key>Undo 
    osfUp :           <Key>Up

To change any of these, you must edit its entry in this resource. For example, if your keyboard doesn't have an F10 key, you could edit the osfMenuBar line and substitute another function key.

Note these points in changing this resource:

Changing the Xterm to Use for I/O

By default, Prism creates a new Xterm for input to and output from a program. Set the Prism.useXterm resource to false to tell Prism not to do this. Instead, I/O will go to the Xterm from which you invoked Prism. You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".

Changing the Way Prism Signals an Error

By default, Prism flashes the command window when there is an error. Set the resource Prism.errorBell to true to tell Prism to ring the bell of your workstation instead. You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".

Changing the make Utility to Use

By default, Prism uses the standard Solaris make utility, /bin/make. Use the resource Prism.make to specify the path name of another version of make to use. You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".

Changing How Prism Treats Stale Data in Visualizers

By default, Prism prints diagonal lines over data in visualizers that has become "stale" because the program has continued execution from the spot where the data was collected. Set the resource Prism.markStaleData to false to tell Prism not to draw these diagonal lines. You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".

Specifying the Browser to Use for Displaying Help

There are several resources you can use to affect the way help is displayed.

By default, graphical Prism uses the Netscape browser to display help information; see " Using the Browser-based Help System". Set the Prism.helpBrowser resource to the executable name of another browser to start; the name must be on your path. Graphical Prism supports Mosaic and Netscape browsers. You can include in the setting any browser-specific options that you want passed to the browser when Prism starts it up. (Note that these options do not take effect if Prism uses an existing browser; see below.)

If you already have a browser running when you request help from Prism, by default Prism displays the help information in this browser. Set the resource Prism.helpUseExisting to false if you want Prism to start a new browser. Set it to true to return to the default behavior.

Changing the Way Prism Handles Fortran 90 Generic Procedures

There are two resources you can use to change the way Prism handles Fortran 90 generic procedures.

By default, Prism displays a menu (in commands-only Prism) or a dialog box when you attempt to set a breakpoint in a Fortran 90 generic procedure. Set the Prism resource Prism.procMenu to false to specify that Prism is to set the breakpoint in every one of these procedures, without displaying a menu or dialog box. You can also change the setting of this resource via the Customize utility; see " Using the Customize Utility".

By default, commands-only Prism displays a maximum of 22 procedures in a menu when you attempt to perform an action (like setting a breakpoint) on a Fortran 90 generic procedure. If there are more than this number of specific procedures, Prism asks you whether you want to specify the name of a specific procedure or to view a menu. Use the Prism.procThresh resource to specify a different maximum. Set the resource to 0 to specify that there is to be no maximum.

Initializing Prism

Use the .prisminit file to initialize Prism when you start it up. You can put any Prism commands into this file. When Prism starts, it executes these commands, echoing them in the history region of the command window.

When starting up, Prism first looks in the current directory for a file called .prisminit. If the file is there, Prism uses it. If the file isn't there, Prism looks for it in your home directory. If the file isn't in either place, Prism starts up without executing a .prisminit file.

The .prisminit file is useful if there are commands that you always want to execute when starting Prism. For example,

Note that you don't need to put pushbutton or tearoff commands into the .prisminit file, because changes you make to the tear-off region are automatically saved when you leave Prism; see " Customizing Different Versions of Prism".

In the .prisminit file, Prism interprets lines beginning with # as comments. If \ is the final character on a line, Prism interprets it as a continuation character.