1.26 <WebKitOptionMenu>

Class: <WebKitOptionMenu>

It derives from <GObject>.

Represents the dropdown menu of a select element in a <WebKitWebView>.

When a select element in a <WebKitWebView> needs to display a dropdown menu, the signal web-view:show-option-menu is emitted, providing a WebKitOptionMenu with the <WebKitOptionMenuItem><!– –>s that should be displayed.

Procedures

Method: option-menu:activate-item self index
Method: activate-item self index

Activates the <WebKitOptionMenuItem> 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 option-menu:close after activating an item, calling this function again will have no effect.

self

Passed: a <WebKitOptionMenu>.

a <WebKitOptionMenu>

index

Passed: an unsigned 32-bit integer.

the index of the item

Method: option-menu:close self
Method: close self

Request to close a <WebKitOptionMenu>.

This emits WebKitOptionMenu::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 option-menu:select-item nor option-menu:activate-item have been called, the element value remains unchanged.

self

Passed: a <WebKitOptionMenu>.

a <WebKitOptionMenu>

Method: option-menu:get-event self ⇒ %return
Method: get-event self ⇒ %return

Gets the <GdkEvent> that triggered the dropdown menu. If self was not triggered by a user interaction, like a mouse click, #f is returned.

self

Passed: a <WebKitOptionMenu>.

a <WebKitOptionMenu>

%return

Returned: a <GdkEvent>.

the menu event or #f.

Method: option-menu:get-item self index ⇒ %return
Method: get-item self index ⇒ %return

Returns the <WebKitOptionMenuItem> at index in self.

self

Passed: a <WebKitOptionMenu>.

a <WebKitOptionMenu>

index

Passed: an unsigned 32-bit integer.

the index of the item

%return

Returned: a <WebKitOptionMenuItem>.

a <WebKitOptionMenuItem> of self.

Method: option-menu:get-n-items self ⇒ %return
Method: get-n-items self ⇒ %return

Gets the length of the self.

self

Passed: a <WebKitOptionMenu>.

a <WebKitOptionMenu>

%return

Returned: an unsigned 32-bit integer.

the number of <WebKitOptionMenuItem><!– –>s in self

Method: option-menu:select-item self index
Method: select-item self index

Selects the <WebKitOptionMenuItem> 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 option-menu:select-item or close the menu with option-menu:close in which case the currently selected item will be activated.

self

Passed: a <WebKitOptionMenu>.

a <WebKitOptionMenu>

index

Passed: an unsigned 32-bit integer.

the index of the item

Signals

Signal: option-menu:close

Connect a handler with (connect object option-menu:close handler). It is called as (handler self).

Emitted when closing a <WebKitOptionMenu> is requested. This can happen when the user explicitly calls option-menu:close or when the element is detached from the current page.

self

Passed: a <WebKitOptionMenu>.