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].
ContextMenu self()Returns `this`, for use in `with` statements.ContextMenuGidBuilder builder()Get builder for [webkit.context_menu.ContextMenu] Returns: New builder objectwebkit.context_menu.ContextMenu newWithItems(webkit.context_menu_item.ContextMenuItem[] items)Creates a new #WebKitContextMenu object with the given items.void append(webkit.context_menu_item.ContextMenuItem item)Adds item at the end of the menu.webkit.context_menu_item.ContextMenuItem first()Gets the first item in the menu. Returns: the first #WebKitContextMenuItem of menu, or null if the #WebKitContextMenu is empty.gdk.event.Event getEvent()Gets 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)Gets the item at the given position in the menu.webkit.context_menu_item.ContextMenuItem[] getItems()Returns the item list of menu. Returns: a #GList of #WebKitContextMenuItem<!-- -->suint getNItems()Gets the length of the menu. Returns: the number of #WebKitContextMenuItem<!-- -->s in menuglib.variant.Variant getUserData()Gets the user data of menu.void insert(webkit.context_menu_item.ContextMenuItem item, int position)Inserts item into the menu at the given position.webkit.context_menu_item.ContextMenuItem last()Gets 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)Moves item to the given position in the menu.void prepend(webkit.context_menu_item.ContextMenuItem item)Adds item at the beginning of the menu.void remove(webkit.context_menu_item.ContextMenuItem item)Removes item from the menu.void removeAll()Removes all items of the menu.void setUserData(glib.variant.Variant userData)Sets user data to menu.Fluent builder for [webkit.context_menu.ContextMenu]