webkit.context_menu

Module for [ContextMenu] class

Types 3

Represents the context menu in a #WebKitWebView.

#WebKitContextMenu represents a context menu containing #WebKitContextMenuItem<!-- -->s in a #WebKitWebView.

When a #WebKitWebView is about to display the context menu, it emits the #WebKitWebView::context-menu signal, which has the #WebKitContextMenu as an argument. You can modify it, adding new submenus that you can create with webkitwebprocessextension.context_menu.ContextMenu.new_, adding new #WebKitContextMenuItem<!-- -->s with webkitwebprocessextension.context_menu.ContextMenu.prepend, webkitwebprocessextension.context_menu.ContextMenu.append or webkitwebprocessextension.context_menu.ContextMenu.insert, maybe after having removed the existing ones with webkitwebprocessextension.context_menu.ContextMenu.removeAll.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
ContextMenu self() nothrowReturns `this`, for use in `with` statements.
ContextMenuGidBuilder builder() static nothrowGet builder for [webkit.context_menu.ContextMenu] Returns: New builder object
webkit.context_menu.ContextMenu newWithItems(webkit.context_menu_item.ContextMenuItem[] items) static nothrowCreates a new #WebKitContextMenu object with the given items.
void append(webkit.context_menu_item.ContextMenuItem item) nothrowAdds item at the end of the menu.
webkit.context_menu_item.ContextMenuItem first() nothrowGets the first item in the menu. Returns: the first #WebKitContextMenuItem of menu, or null if the #WebKitContextMenu is empty.
gdk.event.Event getEvent() nothrowGets the #GdkEvent that triggered the context menu. This function only returns a valid #GdkEvent when called for a #WebKitContextMenu passed to #WebKitWebView::context-menu signal; in all other cas...
webkit.context_menu_item.ContextMenuItem getItemAtPosition(uint position) nothrowGets the item at the given position in the menu.
webkit.context_menu_item.ContextMenuItem[] getItems() nothrowReturns the item list of menu. Returns: a #GList of #WebKitContextMenuItem<!-- -->s
uint getNItems() nothrowGets the length of the menu. Returns: the number of #WebKitContextMenuItem<!-- -->s in menu
glib.variant.Variant getUserData() nothrowGets the user data of menu.
void insert(webkit.context_menu_item.ContextMenuItem item, int position) nothrowInserts item into the menu at the given position.
webkit.context_menu_item.ContextMenuItem last() nothrowGets the last item in the menu. Returns: the last #WebKitContextMenuItem of menu, or null if the #WebKitContextMenu is empty.
void moveItem(webkit.context_menu_item.ContextMenuItem item, int position) nothrowMoves item to the given position in the menu.
void prepend(webkit.context_menu_item.ContextMenuItem item) nothrowAdds item at the beginning of the menu.
void remove(webkit.context_menu_item.ContextMenuItem item) nothrowRemoves item from the menu.
void removeAll() nothrowRemoves all items of the menu.
void setUserData(glib.variant.Variant userData) nothrowSets user data to menu.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new #WebKitContextMenu object.
Methods
ContextMenu build() nothrowCreate object from builder. Returns: New object