WebKit.ContextMenuItem¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class WebKit.ContextMenuItem(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
One item of a
WebKit.ContextMenu.The
WebKit.ContextMenuis composed ofWebKit.ContextMenuItems. These items can be created from a #GtkAction, from aWebKit.ContextMenuActionor from aWebKit.ContextMenuActionand a label. TheseWebKit.ContextMenuActions denote stock actions for the items. You can also create separators and submenus.- classmethod new_from_gaction(action, label, target)¶
- Parameters:
action (
Gio.Action) – aGio.Actionlabel (
str) – the menu item label texttarget (
GLib.VariantorNone) – aGLib.Variantto use as the action target
- Returns:
the newly created
WebKit.ContextMenuItemobject.- Return type:
Creates a new
WebKit.ContextMenuItemfor the given action and label.On activation target will be passed as parameter to the callback.
New in version 2.18.
- classmethod new_from_stock_action(action)¶
- Parameters:
action (
WebKit.ContextMenuAction) – aWebKit.ContextMenuActionstock action- Returns:
the newly created
WebKit.ContextMenuItemobject.- Return type:
Creates a new
WebKit.ContextMenuItemfor the given stock action.Stock actions are handled automatically by WebKit so that, for example, when a menu item created with a
WebKit.ContextMenuAction.STOPis activated the action associated will be handled by WebKit and the current load operation will be stopped. You can get theGio.Actionof aWebKit.ContextMenuItemcreated with aWebKit.ContextMenuActionwithWebKit.ContextMenuItem.get_gaction() and connect to theGio.SimpleAction::activatesignal to be notified when the item is activated, but you can’t prevent the associated action from being performed.
- classmethod new_from_stock_action_with_label(action, label)¶
- Parameters:
action (
WebKit.ContextMenuAction) – aWebKit.ContextMenuActionstock actionlabel (
str) – a custom label text to use instead of the predefined one
- Returns:
the newly created
WebKit.ContextMenuItemobject.- Return type:
Creates a new
WebKit.ContextMenuItemfor the given stock action using the given label.Stock actions have a predefined label, this method can be used to create a
WebKit.ContextMenuItemfor aWebKit.ContextMenuActionbut using a custom label.
- classmethod new_separator()¶
- Returns:
the newly created
WebKit.ContextMenuItemobject.- Return type:
Creates a new
WebKit.ContextMenuItemrepresenting a separator.
- classmethod new_with_submenu(label, submenu)¶
- Parameters:
label (
str) – the menu item label textsubmenu (
WebKit.ContextMenu) – aWebKit.ContextMenuto set
- Returns:
the newly created
WebKit.ContextMenuItemobject.- Return type:
Creates a new
WebKit.ContextMenuItemusing the given label with a submenu.
- get_gaction()¶
- Returns:
the
Gio.Actionassociated to theWebKit.ContextMenuItem, orNoneif self is a separator.- Return type:
Gets the action associated to self as a
Gio.Action.New in version 2.18.
- get_stock_action()¶
- Returns:
the
WebKit.ContextMenuActionof self- Return type:
Gets the
WebKit.ContextMenuActionof self.If the
WebKit.ContextMenuItemwas not created for a stock actionWebKit.ContextMenuAction.CUSTOMwill be returned. If theWebKit.ContextMenuItemis a separatorWebKit.ContextMenuAction.NO_ACTIONwill be returned.
- get_submenu()¶
- Returns:
the
WebKit.ContextMenurepresenting the submenu of self orNoneif self doesn’t have a submenu.- Return type:
Gets the submenu of self.
- is_separator()¶
-
Checks whether self is a separator.
- set_submenu(submenu)¶
- Parameters:
submenu (
WebKit.ContextMenuorNone) – aWebKit.ContextMenu
Sets or replaces the self submenu.
If submenu is
Nonethe current submenu of self is removed.