WebKit.OptionMenu

g GObject.Object GObject.Object WebKit.OptionMenu WebKit.OptionMenu GObject.Object->WebKit.OptionMenu

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

activate_item (index)

close ()

get_event ()

get_item (index)

get_n_items ()

select_item (index)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

close

Emitted when closing a WebKit.OptionMenu is requested.

Fields

Inherited:

GObject.Object (1)

Class Details

class WebKit.OptionMenu(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit.OptionMenuClass

Represents the dropdown menu of a select element in a WebKit.WebView.

When a select element in a WebKit.WebView needs to display a dropdown menu, the signal WebKit.WebView ::show-option-menu is emitted, providing a WebKit.OptionMenu with the WebKit.OptionMenuItem s that should be displayed.

New in version 2.18.

activate_item(index)
Parameters:

index (int) – the index of the item

Activates the WebKit.OptionMenuItem at index in self.

Activating an item changes the value of the element making the item the active one. You are expected to close the menu with WebKit.OptionMenu.close() after activating an item, calling this function again will have no effect.

New in version 2.18.

close()

Request to close a WebKit.OptionMenu.

This emits WebKit.OptionMenu ::close signal. This function should always be called to notify WebKit that the associated menu has been closed. If the menu is closed and neither WebKit.OptionMenu.select_item() nor WebKit.OptionMenu.activate_item() have been called, the element value remains unchanged.

New in version 2.18.

get_event()
Returns:

the menu event or None.

Return type:

Gdk.Event

Gets the Gdk.Event that triggered the dropdown menu. If self was not triggered by a user interaction, like a mouse click, None is returned.

New in version 2.40.

get_item(index)
Parameters:

index (int) – the index of the item

Returns:

a WebKit.OptionMenuItem of self.

Return type:

WebKit.OptionMenuItem

Returns the WebKit.OptionMenuItem at index in self.

New in version 2.18.

get_n_items()
Returns:

the number of WebKit.OptionMenuItem s in self

Return type:

int

Gets the length of the self.

New in version 2.18.

select_item(index)
Parameters:

index (int) – the index of the item

Selects the WebKit.OptionMenuItem at index in self.

Selecting an item changes the text shown by the combo button, but it doesn’t change the value of the element. You need to explicitly activate the item with WebKit.OptionMenu.select_item() or close the menu with WebKit.OptionMenu.close() in which case the currently selected item will be activated.

New in version 2.18.

Signal Details

WebKit.OptionMenu.signals.close(option_menu)
Signal Name:

close

Flags:

RUN_LAST

Parameters:

option_menu (WebKit.OptionMenu) – The object which received the signal

Emitted when closing a WebKit.OptionMenu is requested. This can happen when the user explicitly calls WebKit.OptionMenu.close() or when the element is detached from the current page.

New in version 2.18.