Class ::tycho::MenuBar


Inherits: ::tycho::MenuSupport - Source File - Contents: public methods
This class defines a menu bar widget. The widget is intended to make it easier to manage a complete menu bar, and provides simple access to menu, menu entries, and hierarchical menus. It may become obsolete once Tk 4.3 is out.

Here is an example:

::tycho::TopLevel .f
::tycho::MenuBar .f.mb
pack .f.mb
.f.mb addMenu File
.f.mb add Close File -command {delete object .f}
.f centerOnScreen
.

Public constructs

Public Methods

addMenu name args
Add a menu to the menu bar. The first argument is the name of the menu, and can be any arbitrary string. Remaining arguments control the appearance and layout of the menu. Options include the following:

Other options are supported: the whole set of options supported by the Tk menubutton widget are supported, except for the *-text_ and -menu options.

The above options cannot be changed once the menu has been created. If the specified menu already exists, then this method does nothing.

To specify options of the menu itself, use the menuconfigure method. Note that the menu is created with the menu's -tearoff option set false.

delete menu
Delete a menu or a menu entry. If the specified menu or entry does not exist, nothing happens.
disable name
Disable a menu or a menu entry. Signal an error if the menu or entry does not exist.
enable name
Enable a menu or a menu entry. Signal an error if the menu or entry does not exist.

Index of classes



Author: Farhana Sheikh
Contributor: Edward A. Lee
Version: @(#)MenuBar.itcl 1.12 12/09/96
Copyright: (c) 1995-1996 The Regents of the University of California.