d.menu(1grass) | Grass User's Manual | d.menu(1grass) |
NAME¶
d.menu - Creates and displays a menu within the active frame on the graphics monitor.KEYWORDS¶
display, menuSYNOPSIS¶
d.menuParameters:¶
- bcolor=string
-
- tcolor=string
-
- dcolor=string
-
- size=integer
-
DESCRIPTION¶
d.menu allows the user to create a menu containing a TITLE and options, and to display this menu in the active frame on the graphics monitor. After the menu is displayed in the active frame, the mouse must be used to select one of the menu options. The number associated with the selected menu option is then printed to standard output (stdout) and the program exits. This program provides GRASS macro writers with a mouse interface for user interaction. Parameters can be stated on the command line, from within standard input (stdin), or from within a script file (as illustrated below). The user can specify the menu's background, text, and line colors ( bcolor, tcolor, and dcolor) and the menu size (size) on the command line. If the user sets at least one of these values on the command line, any remaining values that are not specified will be set (automatically) to their default values.NOTES¶
Menu Information:¶
After the user has (optionally) specified menu colors and size, the program expects the user to enter information about the menu's location and content. The menu will be placed in the lower right corner of the active display frame by default if the user does not position it elsewhere using the .T or .L commands. The user specifies the menu contents by entering a menu TITLE followed by the option choices to appear in the menu when displayed. The user must enter a menu TITLE and at least one menu option. All .dot commands are optional.- #
- Comment line. (ignored)
- .B value
- Specifies the menu's background color.
- .C value
- Specifies the menu's text color.
- .D value
- Specifies the menu's dividing line color.
- .F value
- Specifies the menu's font. May be any of the standard GRASS fonts. (see d.font)
- .S value
- Specifies the menu's font size. (as a percentage of the active frame's height).
- .T value
- Specifies the menu's distance from the active display frame's top edge (as a percentage of the active frame's height).
- .L value
- Specifies the menu's distance from the active display frame's left edge (as a percentage of the active frame's width).
- menu TITLE
- A TITLE that describes the type of options listed in the menu, and that will appear at the top of the menu when it is displayed.
- option name(s)
- The options that will appear in the menu when displayed. Each menu option should appear on a separate line. The user may enter as many options as desired, but must enter at least one menu option.
EXAMPLES¶
Example 1¶
Example 2¶
In the following example, the shell script menu2 calls the shell script color.select which contains d.menu commands to display a menu in the current frame on the graphics monitor. After the user selects an option from the display menu, the selection number is available for use by menu2.Contents of file menu2:¶
set color = $colors[$option]
echo $color
Contents of file color.select:¶
NOTES¶
Although the user can vary text size, all text within the same menu is displayed in a single text size (and font). If the user specifies that items included in the menu's text be displayed in different sizes, all text will be displayed in the size stated last.SEE ALSO¶
d.askAUTHOR¶
James Westervelt, U.S. Army Construction Engineering Research Laboratory Last changed: $Date: 2011-11-08 12:29:50 +0100 (Tue, 08 Nov 2011) $ Full index © 2003-2011 GRASS Development TeamGRASS 6.4.2 |