previous next top contents index framed top this page unframed
It is not usually necessary to customize the GUI using the MAINSAIL-specific parameters, except for the change described in Section 3.5, which is advisable once you become accustomed to the GUI. Otherwise, the defaults for the GUI options have been chosen to be reasonable. Follow the steps below only if you are dissatisfied with the default behavior.
MAINEDIT (which is embedded in the GUI) is configured according to information in the parameter file (in the 16.20 release, v1620.prm) and the eparms (“editor parameters”) file. These files are discussed in detail in the Chapter 2 of the MAINEDIT User's Guide (Chapter 28 of the MAINSAIL Language Manual contains additional information on the v1620.prm file, which can be used by many applications).
A sample v1620.prm file is shipped with each MAINSAIL system. The actual parameters in this file are commented out; if you wish to change MAINSAIL-specific parameters:
/usr/openwin/lib
/opt/SUNWmotif/lib
or, on some installations of Solaris 2.5 or later:
/usr/openwin/lib
/usr/dt/lib
e.g., by issuing the command:
% setenv LD_LIBRARY_PATH /usr/openwin/lib:/opt/SUNWmotif/lib<eol>
or:
% setenv LD_LIBRARY_PATH /usr/openwin/lib:/usr/dt/lib<eol>
Otherwise, Motif applications (including MAINSAIL's mainsam bootstrap) will not run.
In addition, on SOLRS, you have to set the following environment variables properly to get key bindings to work correctly for remote X/Motif clients:
setenv MOTIFHOME /opt/SUNWmotif
setenv OPENWINHOME /usr/openwin
setenv XMBINDDIR $MOTIFHOME/lib/bindings
setenv XFILESEARCHPATH $MOTIFHOME/lib/%T/%N%S
The values shown are correct for a typical installation under Solaris
2.3. Values at your site may be different.
3.5. Making the GUI Debugger the Default
Normally, you invoke the GUI by invoking the
MODULE MTFEXE or by
issuing the guidebug response to the Error response prompt.
However, the debugger can also gain control directly from your program
because your program called $debugExec,
and your program may not have been invoked from MTFEXE.
In this case, you get the line-oriented debugger by default rather
than the GUI debugger.
To make the GUI debugger the default, so that it is the interface used when the debugger is initialized by a call to $debugExec, you need to make a MODULE name association between the dummy name GUIDBG and the MODULE name MTFDBG. This association can be made interactively with the MAINEX SETMODULE subcommand (typically put in the $MAINEX group of your parameters file, e.g., v1620.prm):
SETMODULE GUIDBG mtfdbg
or programmatically by calling the PROCEDURE setModName:
setModName("GUIDBG","mtfdbg")
As you interact with the debugger, the display area is divided into a number of “display windows”. These display windows are not the same as Motif windows. All display windows appear within the display area of the single Motif window. The term “window” in this document often means a display window, not a Motif window, depending on context.
The display area is organized as follows for the debugger:
Each window displays the contents of a “buffer”, typically the contents of a source file (except for CMDLOG). The debugger brings new windows into the bottom of the display area. There may be more buffers than windows; e.g., you might have ten buffers, of which only five are currently visible in windows.
Each window in the display area begins with a “status” line that shows:
Depending on which editor front end is in control of the window, other
information may be displayed.
For example, the MAINED front end displays
a mode letter to indicate the current mode (I for “Insert”,
C for “Command”, O for “Overstrike”,
E for “Escape”; see the MAINEDIT User's Guide).
3.7. GUI Commands
GUI commands are entered by selecting an item from one of the
menus
in the menu bar, or by moving the cursor and using the mouse buttons.
The front ends MAINED and
MAINVI also have modes where most keystrokes
are interpreted as commands instead of text to be inserted;
SIMPED does not have such a mode.
The command buttons at the left of the display area are shortcuts for the most frequently used commands (they are labeled with the accelerators for the commands, without the Meta prefix). Instead of selecting a menu item, you can issue the command by clicking the corresponding button. The buttons are shortcuts for a mixture of editing commands and debugging commands (see Sections 3.8 and 3.9).
3.7.1. Issuing Commands
To open a menu, depress the Select
mouse button on a menu name. Release on
a menu item to select it.
If a menu item has an arrow at the right edge
of a menu, moving the mouse to the arrow opens its submenu.
The keyboard
shortcut (also called an “accelerator”)
for a menu item appears at the right of the item
(if the item has an accelerator; not all menu items do). The
keyboard shortcut for a command is usually
the same as the character-based
MAINDEBUG command but with the META
key depressed for all keystrokes.
You must determine which key is the
META key on your terminal; on Sun
keyboards it is either of the “diamond” keys beside the space bar,
but on other keyboards it may be labeled META or ALT.
On some keyboards, there is no META
key by default, and you must
modify your X keymap to establish one if you want to use the keyboard
shortcuts.
Note that there are three ways to issue some commands:
If the name of the menu item ends with “...”,
the item has an associated
dialog window which prompts for information necessary to perform the
command.
Choosing the item invokes the dialog window.
3.7.2. Dialog Windows
Dialog windows display information and ask you for commands necessary
to complete their tasks.
A dialog window usually retains information from
the last time you used it. The following buttons are used with the
indicated standard meanings in many dialog windows:
Menu items are described below in the order in which they appear in the menu bar from left to right. Items within a menu are described in the order in which they appear in the menu from top to bottom. Each menu item is identified with a header of the form:
Menu->Item
or:
Menu->Item->Subitem
For example, File->Kill windows... means the Kill windows...
item in the
File menu. Edit->Go to->Next page means the Next page
item in the Go to
submenu of the Edit menu.
3.8. Editing Commands
3.8.1. Changing the Current Buffer
At any time, the buffer that contains the cursor is the “current”
buffer; most commands take place with respect to that buffer.
The current
buffer is displayed in the “current window”. To make a buffer the
current buffer, click the Select
mouse button (usually the leftmost mouse button)
in the window that displays
the buffer. The cursor is placed at the location where you clicked (but
not beyond the last line of the buffer). You can also click the Select
mouse button on a
window's status line to make it the current window and to put the cursor
at the position it last occupied in the buffer.
3.8.2. Resizing Windows
You can resize windows by using the Select
mouse button to drag a status line
to the desired location. A status line cannot be dragged past another
status line.
3.8.3. Scrolling
All scrollbars have the standard Motif behavior:
To extend a selection, click the Select button with the SHIFT key held down. The text between the current selection and the cursor will be selected (in addition to the already selected text).
To “get rid of” a primary selection,
click the Select button once (anywhere).
This is a useful thing to be able to do, since if there is a primary
selection, commands such as Value use the selected text, whereas if
there is no selection, such commands prompt for the text.
3.8.5. Typing in SIMPED
The only editing facility available in the SIMPED front end
other than those on the Edit menu is the inserting of printing
characters, and the use of special keys.
Insert printing characters by typing those characters on the keyboard.
The special keys you can use in SIMPED are:
Other front ends have an “insert mode” that behaves like SIMPED, but also have other modes in which front-end-specific commands can be entered. See MAINEDIT User's Guide if you are interested.
If the cursor is located within the current selection, the selection is replaced by whatever character you type. Figures 3–2 and 3–3 shows what happens if you select a word (“sentence”) by double-clicking, then type some text to replace it (“line of text”).
Debugging commands let you open MODULEs and contexts for examination and manipulation by the debugger (the Access menu), manipulate breakpoints (the Breaks menu), find a particular context (the MoveTo menu), examine values and memory (the Show menu), and control the execution of the debugger or the debugged program (the Execution menu).
Typically, you start a debug session by running MTFEXE, then setting some breakpoints in your program, then invoking the program from MTFEXE. You can also invoke the Motif debugger by typing guidebug when your program calls errMsg and issues the Error response prompt.
You can invoke the debugger directly from a program by making a call to $debugExec in your program, but this may invoke the line-oriented debugger rather than the Motif debugger. To ensure that the debugger uses the GUI interface even when you initialize the debugger with a call to $debugExec, follow the steps in Section 3.5.
Motif-Based MAINSAIL Tools Reference Guide, Chapter 3