O'Reilly logo

Advanced Perl Programming by Sriram Srinivasan

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

Menus

Menu buttons support the methods shown in Table A.9. They also support the methods of Table A.10 and delegate those calls to the underlying Menu widget.

Table A-9. MenuButton Widget Properties and Methods

Properties

Description

indicatorOn

If true, shows a small diamond to the right of the entry.

state

normal, active, or disabled.

Methods

 

command

separator

radiobutton

checkbutton

cascade

These methods are simply delegated to the underlying menu. Please see the menu object’s description in Table A.10.

menu

Return the underlying menu associated with this menu button.

Each method of the Menu widget understands the following indexing syntax:

number

The index of the entry, starting from 0. When the tear-off option is active, the 0th entry is a separator automatically inserted by the menu.

end, last

Indicates the last entry.

active

Where the location cursor is currently poised. The active location appears underlined.

none

Indicates that none are active. Used along with activate() to deactivate all entries.

pattern

A pattern to be matched against all entries. Currently, only exact matches are guaranteed to work.

Table A.10 shows the properties of the Menu widget and the options available for each type of entry.

Table A-10. Menu Widget Properties and Methods

Menu Widget Properties

Description

indicatorOn

If true, shows a small diamond to the right of the entry.

selectColor

The color of the indicator, if one is displayed.

tearOff

If true, the 0th entry of the menu ...

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