C H A P T E R 8 |
Customizing the Prism Programming Environment |
This chapter discusses ways in which you can change various aspects of the Prism environment's appearance and the way the Prism environment operates. This discussion is organized into the following sections:
Use the .prisminit file to initialize the Prism environment when you start it up. You can put any Prism commands into this file. When the Prism environment starts, it executes these commands, echoing them in the history region of the command window.
When starting up, the Prism environment first looks in the current directory for a file called .prisminit. If the file is there, the Prism environment uses it. If the file isn't there, the Prism environment looks for it in your home directory. If the file isn't in either place, the Prism environment starts up without executing a .prisminit file.
The .prisminit file is useful if there are commands that you always want to execute when starting the Prism environment. 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 the Prism environment; see Customizing MP Prism Mode.
In the .prisminit file, the Prism environment interprets lines enclosed between C-style comment characters, /* and */, as comments. If \ is the final character on a line, the Prism environment interprets it as a continuation character.
Using the .prisminit file, you can reserve commands in your .prisminit file exclusively for debugging multiprocess programs by bracketing the commands with #ifdef MP and #endif. For example, the following command sequence defines c to aliases in the scalar and MP modes of the Prism environment and sets the initial pset to 0 (zero) in the MP Prism mode.
alias c cont #ifdef MP pset 0 alias c "cont; wait every" #endif |
To provide this feature, the Prism environment must preprocess the .prisminit file; by default it does not do this.
To Force the Prism Environment to Preprocess the .prisminit File |
Change the setting of the Prism resource Prism.cppPath, and specify the path to your C preprocessor as its setting.
Typically, this setting is /lib. Thus, you would set the resource as follows:
Prism.cppPath: /lib
See Changing Prism Environment Defaults for information on setting the Prism environment's resources.
Note, however, that the commands-only mode of the Prism environment 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.
You can place frequently used menu selections and commands in the tear-off region below the menu bar. They become buttons that you can click on to execute functions. FIGURE 8-1 shows the buttons that are in this region by default.
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 the Prism environment; see Where the Prism Environment Stores Your Changes for more information.
You can add menu selections to the tear-off region from either the menu bar or the command line.
(prism all) pushbutton label command
The label must be a single word. The command can be any valid Prism command, along with its arguments.
(prism all) 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.
The Prism environment provides commands that let you create alternative names for commands, variables, and expressions.
(prism all) alias new-name command
makes ni an alias for the nexti command. The Prism environment provides some default aliases for common commands. Issue alias with no arguments to display a list of the current aliases.
removes the alias created above.
(prism all) set variable = expression
(prism all) 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,
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, which is described in Initializing the Prism Environment.
Many aspects of the Prism environment'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:
Choose Customize from the Utilities menu.
This displays the window shown in FIGURE 8-3.
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.
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.
The following list summarizes the X Windows system resources that can be modified through the Customize window.
If you specify a visualizer color file, that 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 must contain 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 must contain the color for values that exceed the maximum. The last line must contain the color used to display the values of elements that are not in the context specified by the user in a where statement. The Prism environment uses the colors in between to display the values falling between the minimum and the maximum. See TABLE 8-1 for an example.
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.
The Prism environment maintains a file called .prism_defaults in your home directory. In it, the Prism environment keeps:
Do not attempt to edit this file; make all changes to it through the Prism environment itself. If you remove this file, you get the default configuration the next time you start the Prism environment.
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 in the X resource database has the form:
resource-name: value
where resource-name is the name of the Prism resource, and value is the value to which it is set. TABLE 8-2 lists the Prism resources.
Note that the defaults mentioned in the following sections are the defaults for the Prism environment as it was shipped; your system administrator may have changed these in the Prism environment's file in your system's app-defaults directory.
Note also that the commands-only mode of the Prism environment is not aware of the settings of any Prism resources, unless they are contained in the Prism environment's app-defaults file. This matters only for the resource Prism.cppPath.
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.
% xrdb -merge Prism.editor: emacs |
Note - 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 the Prism environment. |
Consult your X documentation for more information about xrdb.
You can also change the settings of these resources using the Customize window; see Changing Prism Resource Defaults for more information.
Change the setting of the Prism.errorwin resource.
This resource specifies the window the Prism environment is to use for error messages. The 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 Changing Prism Resource Defaults for more information.
You may need to change the fonts that the Prism environment uses. This will be necessary, for example, if the default fonts used by the Prism environment are not available on your system. Use the resources described below to make this change.
You should try to substitute a font that is about the same size as the default value of the Prism environment. Substituting a font that is much larger can cause display problems, since the Prism environment does not resize windows and buttons to accommodate larger fonts.
Edit the Prism.textFont resource.
This setting specifies the resource that the Prism environment is to use in displaying the labels of histograms and text in visualizers. By default, the Prism environment uses a 12-point, fixed-width font for this text.
You can also change the setting of this resource via the Customize utility; see Changing Prism Resource Defaults for more information.
Change the setting of the Prism*XmText.fontList resource.
This setting specifies the font used for most of the running text in the Prism environment, such as code in the source window. By default, the Prism environment uses a 12-point, fixed-width font for this text.
Change the setting of the Prism*fontList resource.
This setting specifies the font used for everything else, such as menu selections, pushbuttons, and list items. By default, the Prism environment uses a 14-point Helvetica font for this text.
The Prism environment provides several resources for changing the default colors it uses when running on a color workstation.
Change the setting of the Prism.vizColormap resource.
This setting specifies a file containing the colors to be used. You can also change the setting of this resource via the Customize utility; see Changing Prism Resource Defaults. See Resource Descriptions for a discussion of how to create a visualizer color file.
Change the setting of the Prism.spectralMapSize resource.
This setting specifies how large the default spectral color map is to be for colormap visualizers. The default is 100 entries. If this many entries causes problems on your workstation, use this resource to specify fewer entries. To set the default to 50, for example, set the resource in your X resource database as follows:
Change the setting of the Prism.dialogColor resource.
This setting specifies the background color of dialog boxes.
Change the setting of the Prism.textBgColor resource.
This setting specifies the background color for text in buttons, dialog boxes, and so on. Note that this setting overrides the setting of the X toolkit -bg option.
Change the setting of the Prism.textMasterColor resource.
This setting specifies the color used to highlight the master pane when the source window is split.
Change the setting of the Prism.graphFillColor resource.
This setting specifies the interior fill color for objects in graphics windows that have 3-D shadow borders.
Change the setting of the Prism.graphBGColor resource.
This setting specifies the background color of all graphics windows, such as the structure browser, Where graph, and visualizer.
Change the setting of the Prism.mainColor resource.
This setting specfies the color used for just about everything else.
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 |
Change the setting of the Prism.comm1Color resource.
This setting specfies the color of the first communicator displayed in the MPI queue visualizer.
Change the setting of the Prism.comm2Color resource.
This setting specifies the color of the second communicator displayed in the MPI queue visualizer.
Change the setting of the Prism.comm3Color resource.
This setting specifies the color of the third communicator displayed in the MPI queue visualizer.
Change the setting of the Prism.commOtherColor resource.
This setting specifies the color of the fourth communicator displayed in the MPI queue visualizer.
Prism.comm1Color: chartreuse2 Prism.comm2Color: cyan2 Prism.comm3Color: magenta2 Prism.commOtherColor: purple |
You can change the keys and key combinations that the Prism environment 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 the Prism environment's file in your system's app-defaults directory.
To Change Keyboard Translations for Dialog Boxes With a Single Text Field |
Change the settings of the Prism.textOneFieldTranslations resource.
This controls default keyboard translations for dialog boxes that contain only one text field. Its default definition is:
The definitions with osf in them are special Motif keyboard symbols.
To Change Keyboard Translations for Dialog Boxes With Several Text Fields |
Change the settings in the Prism.textManyFieldTranslations resource.
If you make a change to any field in one of these resources, you must copy all the definitions.
The Prism environment uses the standard Motif translations that define the general mappings of functions to keys. They are shown below.
Change its entry in the *defaultVirtualBindings resource.
For example, if your keyboard does not have an F10 key, you could edit the osfMenuBar line and substitute another function key.
Note the following points in changing this resource:
By default, the Prism environment creates a new Xterm for input to and output from a program.
To Prevent the Prism Environment From Creating New I/O Windows |
Set the Prism.useXterm resource to false.
This setting causes I/O to go to the Xterm from which you invoked the Prism environment. You can also change the setting of this resource via the Customize utility; see Changing Prism Resource Defaults.
By default, the Prism environment flashes the command window when there is an error. You can, instead, use the bell for signaling errors.
By default, the Prism environment uses the standard Solaris /usr/ccs/bin/make utility. You can use a different make utility by changing the setting of the Prism.make resource.
By default, the Prism environment prints diagonal lines over stale data in visualizers. Data are considered stale when the program has continued execution beyond the spot where the data were collected.
To Prevent the Prism Environment From Depicting Stale Data With Diagonal Lines |
There are several resources you can use to affect the way help is displayed.
By default, the graphical mode of the Prism environment uses the Netscape browser to display help information; see Using the Browser-Based Help System.
To Specify an Alternative HTML Browser for Displaying Online Help |
Set the Prism.helpBrowser resource to the executable name of the other browser.
The name of the browser must be on your path. The graphical mode of the Prism environment supports HTML browsers, such as Netscape. You can include in the setting any browser-specific options that you want passed to the browser when the Prism environment starts it up.
These options do not take effect if the Prism environment uses an existing browser. If you already have a browser running when you request help from the Prism environment, the Prism environment displays the help information in this browser.
Set the resource Prism.helpUseExisting to false.
This forces the Prism environment to start a new browser.
To restore the default behavior, set Prism.helpUseExisting to true.
There are two resources you can use to change the way the Prism environment handles Fortran 90 generic procedures.
By default, the Prism environment displays a menu (in the commands-only mode of the Prism environment) or a dialog box when you attempt to set a breakpoint in a Fortran 90 generic procedure.
To Suppress the Display of Menus or Dialog Boxes When Setting Breakpoints in Fortran 90 Generic Procedures |
By default, the commands-only interface of the Prism environment displays a maximum of 22 procedures on 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, the Prism environment asks you whether you want to specify the name of a specific procedure or to view a menu.
To Display a Different Maximum Number of Fortran 90 Generic Procedures |
Change the setting of the Prism.procThresh resource.
This specifies a different maximum number of procedures. Set the resource to 0 (zero) to specify that there is to be no maximum.
Copyright © 2002, Sun Microsystems, Inc. All rights reserved.