The [menuBar] command.

The menuBar command lets you access the basic properties of the current menu bar in Alpha. The menus themselves can be created and manipulated using the [menuRef] and the [menuItem] commands.


The formal syntax of the [menuBar] command is:
menuBar subcommand
The possible subcommands are:
menuBar showshow the menu bar
menuBar hidehide the menu bar
menuBar visibleis the menu bar visible
menuBar countnumber of items in the menu bar
menuBar listlist of menus currently present

The list returned by the [menuBar list] command is a list of tokens corresponding to menus present in the menu bar. It is the same token expected by the various
[menuRef] and [menuItem] subcommands.
Note that the [menuBar count] and [menuBar list] commands do take into account the application menu and the help menu whose tokens are application and help respectively.


Here are a few examples which can be executed from the Tcl Shell:
    menuBar count
    menuBar list
    # Create a new menu and insert it in the menu bar
    set tkn [menuRef create -title "Test"]
    menuRef insert $tkn
    menuBar list
    # Hide the menu bar
    menuBar hide
    menuBar visible

    # Show it again
    menuBar show
    menuBar visible

Last updated 2016-11-23 15:54:16