gi-webkit2-4.0.29: WebKit2 bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.WebKit2.Objects.OptionMenu

Description

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

When a select element in a WebView needs to display a dropdown menu, the signal WebView::showOptionMenu is emitted, providing a WebKitOptionMenu with the OptionMenuItems that should be displayed.

Since: 2.18

Synopsis

Exported types

newtype OptionMenu Source #

Memory-managed wrapper type.

Constructors

OptionMenu (ManagedPtr OptionMenu) 

Instances

Instances details
Eq OptionMenu Source # 
Instance details

Defined in GI.WebKit2.Objects.OptionMenu

GObject OptionMenu Source # 
Instance details

Defined in GI.WebKit2.Objects.OptionMenu

ManagedPtrNewtype OptionMenu Source # 
Instance details

Defined in GI.WebKit2.Objects.OptionMenu

Methods

toManagedPtr :: OptionMenu -> ManagedPtr OptionMenu

TypedObject OptionMenu Source # 
Instance details

Defined in GI.WebKit2.Objects.OptionMenu

Methods

glibType :: IO GType

HasParentTypes OptionMenu Source # 
Instance details

Defined in GI.WebKit2.Objects.OptionMenu

IsGValue (Maybe OptionMenu) Source #

Convert OptionMenu to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.WebKit2.Objects.OptionMenu

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe OptionMenu -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe OptionMenu)

type ParentTypes OptionMenu Source # 
Instance details

Defined in GI.WebKit2.Objects.OptionMenu

type ParentTypes OptionMenu = '[Object]

class (GObject o, IsDescendantOf OptionMenu o) => IsOptionMenu o Source #

Type class for types which can be safely cast to OptionMenu, for instance with toOptionMenu.

Instances

Instances details
(GObject o, IsDescendantOf OptionMenu o) => IsOptionMenu o Source # 
Instance details

Defined in GI.WebKit2.Objects.OptionMenu

toOptionMenu :: (MonadIO m, IsOptionMenu o) => o -> m OptionMenu Source #

Cast to OptionMenu, for types for which this is known to be safe. For general casts, use castTo.

Methods

activateItem

optionMenuActivateItem Source #

Arguments

:: (HasCallStack, MonadIO m, IsOptionMenu a) 
=> a

menu: a OptionMenu

-> Word32

index: the index of the item

-> m () 

Activates the OptionMenuItem at index in menu.

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

Since: 2.18

close

optionMenuClose Source #

Arguments

:: (HasCallStack, MonadIO m, IsOptionMenu a) 
=> a

menu: a OptionMenu

-> m () 

Request to close a OptionMenu.

This emits WebKitOptionMenuclose signal. This function should always be called to notify WebKit that the associated menu has been closed. If the menu is closed and neither optionMenuSelectItem nor optionMenuActivateItem have been called, the element value remains unchanged.

Since: 2.18

getItem

optionMenuGetItem Source #

Arguments

:: (HasCallStack, MonadIO m, IsOptionMenu a) 
=> a

menu: a OptionMenu

-> Word32

index: the index of the item

-> m (Maybe OptionMenuItem)

Returns: a OptionMenuItem of menu.

Returns the OptionMenuItem at index in menu.

Since: 2.18

getNItems

optionMenuGetNItems Source #

Arguments

:: (HasCallStack, MonadIO m, IsOptionMenu a) 
=> a

menu: a OptionMenu

-> m Word32

Returns: the number of OptionMenuItems in menu

Gets the length of the menu.

Since: 2.18

selectItem

optionMenuSelectItem Source #

Arguments

:: (HasCallStack, MonadIO m, IsOptionMenu a) 
=> a

menu: a OptionMenu

-> Word32

index: the index of the item

-> m () 

Selects the OptionMenuItem at index in menu.

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 optionMenuSelectItem or close the menu with optionMenuClose in which case the currently selected item will be activated.

Since: 2.18

Signals

close

type OptionMenuCloseCallback = IO () Source #

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

Since: 2.18

afterOptionMenuClose :: (IsOptionMenu a, MonadIO m) => a -> ((?self :: a) => OptionMenuCloseCallback) -> m SignalHandlerId Source #

Connect a signal handler for the close signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after optionMenu #close callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onOptionMenuClose :: (IsOptionMenu a, MonadIO m) => a -> ((?self :: a) => OptionMenuCloseCallback) -> m SignalHandlerId Source #

Connect a signal handler for the close signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on optionMenu #close callback