ContextMenu

class ContextMenu(pointer: <Error class: unknown class><<Error class: unknown class>>)

Represents the context menu in a #WebKitWebView.

#WebKitContextMenu represents a context menu containing #WebKitContextMenuItems 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 webkit_context_menu_new(), adding new #WebKitContextMenuItems with webkit_context_menu_prepend(), webkit_context_menu_append() or webkit_context_menu_insert(), maybe after having removed the existing ones with webkit_context_menu_remove_all().

Constructors

Link copied to clipboard
constructor()

Creates a new #WebKitContextMenu object.

constructor(items: <Error class: unknown class>)

Creates a new #WebKitContextMenu object with the given items.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val webkitContextMenuPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard

Adds @item at the end of the @menu.

Link copied to clipboard

Gets the first item in the @menu.

Link copied to clipboard
fun getEvent(): <Error class: unknown class>

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 cases, null is returned.

Link copied to clipboard
fun getItemAtPosition(position: <Error class: unknown class>): ContextMenuItem

Gets the item at the given position in the @menu.

Link copied to clipboard
fun getItems(): <Error class: unknown class>

Returns the item list of @menu.

Link copied to clipboard
fun getNItems(): <Error class: unknown class>

Gets the length of the @menu.

Link copied to clipboard
fun getUserData(): <Error class: unknown class>

Gets the user data of @menu.

Link copied to clipboard
fun insert(item: ContextMenuItem, position: <Error class: unknown class>)

Inserts @item into the @menu at the given position.

Link copied to clipboard

Gets the last item in the @menu.

Link copied to clipboard
fun moveItem(item: ContextMenuItem, position: <Error class: unknown class>)

Moves @item to the given position in the @menu.

Link copied to clipboard

Adds @item at the beginning of the @menu.

Link copied to clipboard

Removes @item from the @menu.

Link copied to clipboard
fun removeAll()

Removes all items of the @menu.

Link copied to clipboard
fun setUserData(userData: <Error class: unknown class>)

Sets user data to @menu.