WebKit2.ContextMenuItem.new_from_stock_action
function new_from_stock_action(action: WebKit2.ContextMenuAction): WebKit2.ContextMenuItem { // Gjs wrapper for webkit_context_menu_item_new_from_stock_action() }
Creates a new WebKit2.ContextMenuItem for the given stock action. Stock actions are handled automatically by WebKit so that, for example, when a menu item created with a WebKit2.ContextMenuAction.stop is activated the action associated will be handled by WebKit and the current load operation will be stopped. You can get the Gtk.Action of a WebKit2.ContextMenuItem created with a WebKit2.ContextMenuAction with WebKit2.ContextMenuItem.prototype.get_action and connect to #GtkAction::activate signal to be notified when the item is activated. But you can't prevent the asociated action from being performed.
- action
a WebKit2.ContextMenuAction stock action
- Returns
the newly created WebKit2.ContextMenuItem object.