WebKit2.OptionMenu¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when closing a |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class WebKit2.OptionMenu(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Represents the dropdown menu of a
select
element in aWebKit2.WebView
.When a select element in a
WebKit2.WebView
needs to display a dropdown menu, the signalWebKit2.WebView
::show-option-menu
is emitted, providing aWebKit2.OptionMenu
with theWebKit2.OptionMenuItem
s that should be displayed.New in version 2.18.
- activate_item(index)¶
- Parameters:
index (
int
) – the index of the item
Activates the
WebKit2.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
WebKit2.OptionMenu.close
() after activating an item, calling this function again will have no effect.New in version 2.18.
- close()¶
Request to close a
WebKit2.OptionMenu
.This emits
WebKit2.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 neitherWebKit2.OptionMenu.select_item
() norWebKit2.OptionMenu.activate_item
() have been called, the element value remains unchanged.New in version 2.18.
- get_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
WebKit2.OptionMenuItem
of self.- Return type:
Returns the
WebKit2.OptionMenuItem
at index in self.New in version 2.18.
- get_n_items()¶
- Returns:
the number of
WebKit2.OptionMenuItem
s in self- Return type:
Gets the length of the self.
New in version 2.18.
- select_item(index)¶
- Parameters:
index (
int
) – the index of the item
Selects the
WebKit2.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
WebKit2.OptionMenu.select_item
() or close the menu withWebKit2.OptionMenu.close
() in which case the currently selected item will be activated.New in version 2.18.
Signal Details¶
- WebKit2.OptionMenu.signals.close(option_menu)¶
- Signal Name:
close
- Flags:
- Parameters:
option_menu (
WebKit2.OptionMenu
) – The object which received the signal
Emitted when closing a
WebKit2.OptionMenu
is requested. This can happen when the user explicitly callsWebKit2.OptionMenu.close
() or when the element is detached from the current page.New in version 2.18.