- Showmenu
- Synopsis
- Description
- Remote operation
- Environmental variables
- Syntax of menus
- Authors
- See also
Showmenu
showmenu - graphical user interface (GUI) for CONTROL, MCTL, PCTL, and other CIO based programsSynopsis
showmenu [outputstream inputstream]Description
SHOWMENU is loaded and started by the command MENU in programs CONTROL, MCTL, PCTL, or other CIO application programs (further just called CONTROL). It replaces the standard input by an X11 graphical user interface.For many menu options, parameters are required. These may be typed in after selecting the parameter with the left mouse button. Most parameters have default values as displayed.
Selecting a menu option - by the left mouse button - causes a new menu to be displayed, or, a command to be sent to CONTROL. Options that send a command are indicated in capitals. If the right mouse button is used, instead of the command a help request is sent to CONTROL.
The middle mouse button may be used at all times to return to the main menu.
Each menu shows a "command line" bar. One may type an input line for control in this bar, and, by typing <return>, send it verbatim.
Each menu corresponds to a file in the menu directory. Default values for parameters may be specified in this menu file, or requested from the program control.
When the program SHOWMENU is terminated, the standard input of CONTROL is resumed from the original terminal.
Remote operation
When program CONTROL runs on an OS9 system, SHOWMENU can be used via an rpc(3C) based interface. Then, on the X11 host computer a daemon named rgui_svc has to be started first. This may be done by the script svc(1).In the OS9 verion of CONTROL the command 'grint host <hostname>' selects the host for GRINT as well as for SHOWMENU. This command should therefore be given before the command MENU.
Environmental variables
XSCALE : controls the size of the menu window 'normal' values are 0.5 < XSCALE < 1.0 default=0.5 SHOWMENU : alternative program to be loaded (default, see below) CONTROLMENUDIR : alternative directory for CONTROL-specific features MCTLMENUDIR : alternative directory for MCTL-specific features PCTLMENUDIR : alternative directory for PCTL-specific features GAUSSMENUDIR : alternative directory for GAUSS-specific features MENUDIR : alternative directory for general CIO features. users may make their own menu variations by using these variables To specify several menu directories separate them by colons ':', like in the PATH variable. Example: setenv MCTLMENUDIR ~/menu/MCTL:/usr/local/menu/MCTL
Syntax of menus
Components of a menufile
- General structure
NAME <text> TEXT % <one or more lines of text> % MENU [ options ] ENDM PARA [ parameters ] ENDP ASKD <default_request command> [ RSLT strings ]
- Options
OPT<digit> <option text> <option_directive> Note: Use capitals in <option text> if the option causes an action such as EXEC or EXCS (see below). a) option_directives One of the following directives: EXEC <digit> EXCS <digit> STOP <next_menu name> Optionally the EXEC, EXCS and STOP directives may be followed by a semicolon and a next_menu name: EXEC <digit> ; <next_menu name> EXCS <digit> ; <next_menu name> STOP ; <next_menu name> Notes: EXEC and EXCS cause execution of the corresponding RSLT string. After EXEC the program returns to the current menu, after processing the RSLT string, and, if specified, after processing the next_menu. After EXCS or STOP the program jumps to the next_menu. If no next_menu is specified, the previous menu is re-actived. It is possible to jump to a previous menu in the current 'tree', or to a new menu. Example: STOP ; main.menu
- Parameters
PAR<number> <text> <parameter_type> DFLT <default_descriptor> a) parameter_type One of the following: STRING WORD INT DOUBLE MENU TABLE After MENU some extra lines follow: <number of menu options> (one line) [<parametername> =]<parameter value> (one line for each menu option) After TABLE some extra lines follow: <number of options> (one line) <option name> (one line for each menu option) where <option name> is one of the following: UPDATE NO CHANGE SKIP Notes: The '<parametername>=' in parameters of type MENU is an optional descriptive text for the benefit of the user. A parameter of type WORD is enclosed by single apostrophs when it is used. The options after TABLE have no effect at the time they are selected, but only at the time the parameter is used in an RSLT string, see section 5 b). b) default_descriptor One of the following: NULL (means: no default for this parameter) @<default_name> (means: the default is a value, obtained via the default_request command, see ASKD) <parameter value> (any string, not beginning with @ or NULL is taken litterally)
- Default_request command
This command, consists of a mnemonic, followed by <space> !, (example: DIS !) and is sent to the program on whose behalf showmenu is running. This program is expected to return lines containing <default_name> <space> <string>, terminated by an empty line.
- RSLT strings
RSLT<digit> <command> Note: <digit> may be absent, RSLT is equivalent to RSLT0. a) Parameter substitution The string <command> is sent to the program on whose behalf showmenu is running, when the RSLT string is activated (see EXEC and EXCS). Before the string is sent, parameter substitution takes place. Each occurence of @<number> is substituted by the value of the parameter PAR<number>. b) Parameter substitution of type TABLE If the parameter referred to by @<number> in a RSLT string is of type TABLE the action depends on the selected option: UPDATE • A table request is sent to host program. • This program should return: <nrows> <ncolumns> (one line) followed by <nrows>*<ncolumns> lines, each containing a table element. • The program showmenu displays the table, and allows the users to make changes. • The modified table is sent back to the host. (<nrows>*<ncolumns> lines, each containing a table element) NO CHANGE The same as UPDATE, except that step c) is omitted. SKIP The parameter is replaced by a null string. NO CHANGE and SKIP can both be used when default values are to be used. If the host program is able to take default action when an empty string (or a ';') is received use SKIP, if the program needs exactly the right number of data use NO CHANGE.
- The first menu file
There must be a file in the menudir path, with file name "main.menu". This is the first menu displayed.