Technical data

add_menuitem
268
-
Simulator Command Reference ModelSim EE/PLUS Reference Manual
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 (p377).
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 (p264),
add_menucb
command (p266),
add_separator
command (p269),
add_submenu
command (p270), and the
change_menu_cmd
command (p282)
The
add_menuitem
command is also used as part of the
add_menu
(p264)
example.