Technical data
add_menu
CR-26 ModelSim Commands ModelSim EE/SE Command Reference
add_menu
The add_menu command adds a menu to the menu bar of the specified window,
using the specified menu name. The menu may be justified to the left or right side
of the menu bar. Use the add_menuitem
(CR-30), add_separator (CR-31),
add_menucb
(CR-28), and add_submenu (CR-32) commands to complete the
menu.
Returns the full Tk pathname of the new menu.
Color and other Tk properties of the menu may be changed, after creating the
menu, using the Tk menu widget configure command.
Syntax
add_menu
<window_name> <menu_name> [<shortcut>] [<side>]
Arguments
<window_name>
Tk path of the window to contain the menu. Required.
<menu_name>
Name to be given to the Tk menu widget. Required.
<shortcut>
Number of the letter in the menu name that is to be used as the shortcut.
Numbering starts with 0 (i.e., first letter = 0, second letter = 1, third letter = 2, etc.).
Optional. Default is "-1", which indicates no shortcut is to be used.
<side>
Justify the menu "left" or "right". Optional. Default is "left".
Examples
The following Tcl code is an example of creating user-customized menus. It adds
a menu containing a top-level item labeled "Do My Own Thing...", which prints
"my_own_thing.signals"; adds a cascading submenu labeled "changeCase" with
two entries, "To Upper" and "To Lower", which echo "my_to_upper" and
"my_to_lower" respectively. A # checkbox that controls the value of myglobalvar
(.signals:one) is also added.
view signals
set myglobalvar(.signals:one) 0
set myglobalvar(.signals:two) 1
proc AddMyMenus {wname} {