Class
WebKit2ContextMenuItem
Description [src]
class WebKit2.ContextMenuItem : GObject.InitiallyUnowned {
parent: GInitiallyUnowned,
priv: WebKitContextMenuItemPrivate*
}
One item of a WebKitContextMenu
.
The WebKitContextMenu
is composed of WebKitContextMenuItem
s. These items can be created from a GtkAction
, from a
WebKitContextMenuAction
or from a WebKitContextMenuAction
and a
label. These WebKitContextMenuAction
s denote stock actions
for the items. You can also create separators and submenus.
Constructors
webkit_context_menu_item_new
Creates a new WebKitContextMenuItem
for the given action
.
Deprecated since: 2.18
webkit_context_menu_item_new_from_gaction
Creates a new WebKitContextMenuItem
for the given action
and label
. On activation
target
will be passed as parameter to the callback.
Available since: 2.18
webkit_context_menu_item_new_from_stock_action
Creates a new WebKitContextMenuItem
for the given stock action.
Stock actions are handled automatically by WebKit so that, for example,
when a menu item created with a WEBKIT_CONTEXT_MENU_ACTION_STOP
is
activated the action associated will be handled by WebKit and the current
load operation will be stopped. You can get the GAction
of a
WebKitContextMenuItem
created with a WebKitContextMenuAction
with
webkit_context_menu_item_get_gaction()
and connect to the GSimpleAction::activate
signal
to be notified when the item is activated, but you can’t prevent the associated
action from being performed.
webkit_context_menu_item_new_from_stock_action_with_label
Creates a new WebKitContextMenuItem
for the given stock action using the given label
.
Stock actions have a predefined label, this method can be used to create a
WebKitContextMenuItem
for a WebKitContextMenuAction
but using a custom label.
webkit_context_menu_item_new_separator
Creates a new WebKitContextMenuItem
representing a separator.
webkit_context_menu_item_new_with_submenu
Creates a new WebKitContextMenuItem
using the given label
with a submenu.
Instance methods
webkit_context_menu_item_get_action
Gets the action associated to item
as a GtkAction
.
Deprecated since: 2.18
webkit_context_menu_item_get_gaction
Gets the action associated to item
as a GAction
.
Available since: 2.18
webkit_context_menu_item_get_stock_action
Gets the WebKitContextMenuAction
of item
. If the WebKitContextMenuItem
was not
created for a stock action WEBKIT_CONTEXT_MENU_ACTION_CUSTOM
will be
returned. If the WebKitContextMenuItem
is a separator WEBKIT_CONTEXT_MENU_ACTION_NO_ACTION
will be returned.
webkit_context_menu_item_get_submenu
Gets the submenu of item
.
webkit_context_menu_item_is_separator
Checks whether item
is a separator.
webkit_context_menu_item_set_submenu
Sets or replaces the item
submenu. If submenu
is NULL
the current
submenu of item
is removed.
Signals
Signals inherited from GObject (1)
GObject.Object::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Class structure
struct WebKit2ContextMenuItemClass {
GInitiallyUnownedClass parent_class;
void (* _webkit_reserved0) (
void
);
void (* _webkit_reserved1) (
void
);
void (* _webkit_reserved2) (
void
);
void (* _webkit_reserved3) (
void
);
}
Class members
parent_class |
|
No description available. | |
_webkit_reserved0 |
|
No description available. | |
_webkit_reserved1 |
|
No description available. | |
_webkit_reserved2 |
|
No description available. | |
_webkit_reserved3 |
|
No description available. |