O'Reilly logo

Tcl/Tk 8.5 Programming Cookbook by Bert Wheeler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a menu

In Tk the menu is not just a name for a part of your GUI, but also the actual widget command name as well. The menu command will create a new menu widget.

The syntax is as follows:

	menu name option value…

The menu command accepts one or more option value pairs, as detailed in the following table:

Option

Interpretation

-accelerator

Specifies an accelerator or keyboard hotkeys to be displayed to the right-hand side of the menu text. The specific acceptable values are dependent on the display manager in use. For example, in a Windows application, Control+N would be an acceptable value.

-activebackground

Specifies the background color to be used when drawing the element. The active background is the color used when the mouse ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required