Technical data

add_menuitem
CR-30 ModelSim Commands ModelSim EE/SE Command Reference
add_menuitem
The add_menuitem command creates a menu item within the specified menu of
the specified window. May be used within a submenu. Returns nothing.
Syntax
add_menuitem
<window_name> <menu_path> <Text> <Cmd> [<accel_key>]
Arguments
<window_name>
Tk path of the window containing the menu. Required.
<menu_path>
Name of the Tk menu widget plus submenu path. Required.
<Text>
Text to be displayed. Required.
<Cmd>
The command to be executed when the menu item is selected with the left mouse
button. To echo the command and display the return value in the Main window,
prefix the command with the transcribe command
(CR-157). Transcribe will also
echo the results to the transcript window. Required.
<accel_key>
A number, starting from 0, of the letter to underline in the menu text. Used to
indicate a keyboard shortcut key. Optional. Default is to pick the first character in
<Text> that is unique across the menu items within the menu.
If accel_key = 1, no letter is underlined and no acceleration key will be defined.
Examples
add_menuitem $wname user "Save Results As..." $my_save_cmd
See also
add_menu command
(CR-26), add_menucb command (CR-28), add_separator
command
(CR-31), add_submenu command (CR-32), and the change_menu_cmd
command
(CR-44)
The add_menuitem command is also used as part of the add_menu
(CR-26)
example.