WebKit.OptionMenu¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when closing a |
Fields¶
- Inherited:
Class Details¶
- class WebKit.OptionMenu(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Represents the dropdown menu of a
select
element in aWebKit.WebView
.When a select element in a
WebKit.WebView
needs to display a dropdown menu, the signalWebKit.WebView
::show-option-menu
is emitted, providing aWebKit.OptionMenu
with theWebKit.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 neitherWebKit.OptionMenu.select_item
() norWebKit.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
WebKit.OptionMenuItem
of self.- Return type:
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:
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 withWebKit.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:
- 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 callsWebKit.OptionMenu.close
() or when the element is detached from the current page.New in version 2.18.