PopupMenu (hwx.gui)

A PopupMenu Widget.

The PopupMenu is a specialized control that has the abilty of being selected. You can add items and commands to the popup menu.


Public Methods

clear (self)
insertItem (self, text, menu=None, icon=None, command=None, enabled=True, checked=None)
insertMenu (self, text)
insertSeparator (self)
popup (self, event=None)

Method Details


Remove all items.

insertItem(self, text, menu=None, icon=None, command=None, enabled=True, checked=None)

Inserts item and command into menu.

param text:The item text to be displayed.
type text:str
param menu:The menu object to insert.
type menu:CascadingMenu, optional
param icon:The name of the icon file.
type icon:str, optional
param command:The callback method to be executed when item is clicked.
type command:callback, optional
param enabled:Determines whether to enable the inserted item.
type enabled:bool, optional
param checked:Determines if the item is checkable. True or False makes it checkable.
type checked:bool, optional
returns:The index where the item has been inserted.
insertMenu(self, text)

Adds and returns a cascading menu.


Inserts a separator in the Pop menu.

popup(self, event=None)

Shows the Popup menu.

param event:The event to get the mouse position.
type event:MouseEvent, optional