| Top |
|
|
_init () |
|
|
addAction () |
|
|
addSettingsAction () |
|
|
addCommandlineAction () |
|
|
isChildMenu () |
|
|
addChildMenu () |
|
|
removeChildMenu () |
|
|
addMenuItem () |
|
|
getColumnWidths () |
|
|
setColumnWidths () |
|
|
removeAll () |
|
|
toggle () |
|
|
toggle_with_options () |
|
|
destroy () |
| St.Widget | sourceActor | |
| St.BoxLayout | box | |
| boolean | isOpen | |
| boolean | blockSourceEvents | |
| boolean | passEvents | |
| PopupMenu.PopupBaseMenuItem | firstMenuItem | |
| int | numMenuItems |
This is a base popup menu class for more sophisticated popup menus to inherit. This cannot be instantiated.
PopupMenu.PopupMenuItem addAction (string title,function callback);
Adds a PopupMenuItem with label title to the menu. When the item is clicked, callback will be called.
PopupMenu.PopupMenuItem addSettingsAction (string title,string module);
Adds a PopupMenuItem with label title to the menu. When the item is clicked, Cinnamon Settings will be launched with the module module activated.
PopupMenu.PopupMenuItem addCommandlineAction (string title,string cmd);
Adds a PopupMenuItem with label title to the menu. When the item is clicked, the command cmd will be executed.
removeChildMenu (PopupMenuBase menu);
Removes menu from the current menu if it is a child.
addMenuItem (PopupMenu.PopupBaseMenuItem menuItem,int position);
Adds the menuItem to the menu.
menuItem |
the item to include (can also be a |
|
position |
(optional) position to add the item at (empty for end of menu) |
getColumnWidths ();
Gets the width of each column this thing has. In popup menus, everything is put into columns, and the columns of all items align. This is used internally and shouldn't be fiddled with unless you are implementing other popup menu items.
setColumnWidths (array widths);
Sets the widths of each column according to widths so that things can align.
toggle_with_options (boolean animate,function onComplete);
Toggles the open/close state of the menu with extra parameters
“blockSourceEvents” property “blockSourceEvents” boolean
If set, we don't send events (including crossing events) to the source actor for the menu which causes its prelight state to freeze
“passEvents” property “passEvents” boolean
Can be set while a menu is up to let all events through without special menu handling useful for scrollbars in menus, and probably not otherwise.
“firstMenuItem” property “firstMenuItem” PopupMenu.PopupBaseMenuItem
The first item in the popup menu
“child-menu-added” signal
user_function (PopupMenu.PopupMenuBase menu);
Emitted when an menu is added as a submenu.
“child-menu-removed” signal
user_function (PopupMenu.PopupMenuBase menu);
Emitted when an submenu is removed.
“activate” signaluser_function (PopupBaseMenuItem menuItem,boolean keepMenu);
Emitted when an item of the menu is activated.
“active-changed” signal
user_function (PopupBaseMenuItem menuItem);
Emitted when the active item of menu is changed.