Using menu methods
The menu widget contains a host of different methods, in addition to the core methods such as destroy
, disable
, enable
, option
, and widget
, which means that it has a rich set of different behaviors. It also supports the implementation of advanced functionality that allows us to work with it programmatically. Let's take a look at the methods, which are listed in the following table:
Option |
Use |
---|---|
|
Removes focus from a menu, resets any active element styles, and triggers the menu's |
|
Closes the currently active submenu. |
|
Closes all open submenus. |
|
Opens the submenu below the currently active item, if one exists. |
|
Activates a particular menu item, begins opening any submenu, if present, and triggers the menu's |
|
Returns a Boolean value stating whether or not the currently active item is the first item in the menu. |
|
Returns a Boolean value stating whether or not the currently... |