Menus

The menu associated with a menubutton must be a child widget of the menubutton. Similarly, the menu for a cascade menu entry must be a child of the menu.

The @y index for a menu always returns a valid index, even if the mouse cursor is outside any entry. In this case, it simply returns the index of the closest entry, instead of none.

The selector attribute is now selectColor.

The postcascade operation posts the menu of a cascade entry:

$menu postcascade index
					

The insert operation adds a menu entry before a specified entry:

$menu insert index type options...

Chapter 27 describes menus starting at page 396.

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.