Technical data

add_menu
264
-
Simulator Command Reference ModelSim EE/PLUS Reference Manual
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
(p268),
add_separator
(p269),
add_menucb
(p266), and
add_submenu
(p270) 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> [<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.
<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} {
global myglobalvar
set cmd1 "echo my_own_thing $wname"
set cmd2 "echo my_to_upper $wname"
set cmd3 "echo my_to_lower $wname"