menuBar -- A menu container widget.


menuBar [-option value...]




type: list of widget-IDs (default: "")

List of menu items to be included in the menubar.


type: string

Name of the widget, can be used to set options in an rc file.


type: boolean (default: 1)

Whether or not the item is sensitve to user input.


type: boolean (default: 1)

Whether or not the item is visible.


A menubar is a container widget which is used normally at the top of the main window.


id delete

Deletes the widget and the associated tcl command.

id configure [-option value...]

Configures the widget. Option may have any of the values accepted on creation of the widget.

id add list-of-widget-Ids

Add widgets to the menubar.

id addBegin list-of-widget-Ids

Synonym for add.

id addEnd list-of-widget-Ids

Add widgets at the end of the menubar.


set menuBar [gnocl::menuBar]
set menu [gnocl::menu]
$menu add [gnocl::menuItem -text "%#Quit" -onClicked exit]
$menuBar add [gnocl::menuItem -text "%__File" -submenu $menu]
set menu [gnocl::menu]
$menu add [gnocl::menuItem -text "%__About" -onClicked {puts "About Gnocl"}]
$menuBar add [gnocl::menuItem -text "%__Help" -submenu $menu]
gnocl::window -title "MenuBar" -child $menuBar

results in

See also

menuItem, menuCheckItem, menuRadioItem, menuSeparator, menu, GtkMenuBar