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.
Synopsis
The formal syntax of the [menuBar] command is:
menuBar subcommand ?options? |
The possible subcommands are:
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.
Examples
Here are a few examples which can be executed, one by one, from the
Tcl Shell (⌘Y
):
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 2020-10-21 07:16:36