menu pathName [option value...]

The menu command creates a new menu widget named pathName. A menu is a top-level window that displays a collection of one-line entries arranged in one or more columns. Several different types of menu entries exist and can be combined in a single menu.

Standard Options













Widget-Specific Options

-postcommand command (postCommand, Command)

Command to evaluate each time the menu is posted.

-selectcolor color (selectColor, Background)

Color to display in the indicator when menu entries of type checkbutton or radiobutton are selected.

-tearoff boolean (tearOff, TearOff)

Whether the menu should include a tear-off entry at the top.

-tearoffcommand command (tearOffCommand, TearOffCommand)

Command to evaluate whenever menu is torn off. The menu widget’s name and the name of the window for the torn-off menu are appended as the last two arguments.

-title string (title, Title)

String to use as a title for the window created when the menu is torn off.

-type type (type, Type)

Menu’s type. Type must be menubar, tearoff, or normal. Can only be set at menu’s creation.

Entry Indices

Several menu widget methods support the notion of an index for identifying a particular entry position within the menu. Indices have the following form:


The entry numerically, where 0 is the topmost entry.


The entry that is currently active.


The bottommost ...

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.