monomer-1.6.0.1: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Monomer.Widgets.Singles.TextDropdown

Description

Dropdown widget, allowing selection of a single item from a collapsable list. Both header and list content are text based.

textDropdown textLens ["Option 1", "Option 2", "Option 3"]

In case a customizable version is needed, to display rich content in the header or list items, Monomer.Widgets.Containers.Dropdown can be used.

Synopsis

Configuration

type TextDropdownItem a = DropdownItem a Source #

Constraints for an item handled by textDropdown.

Constructors

textDropdown Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, TextShow a) 
=> ALens' s a

The lens into the model.

-> t a

The list of items.

-> WidgetNode s e

The created text dropdown.

Creates a text dropdown using the given lens. The type must have a TextShow instance.

textDropdown_ Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a) 
=> ALens' s a

The lens into the model.

-> t a

The list of items.

-> (a -> Text)

The function for converting to Text.

-> [DropdownCfg s e a]

The config options.

-> WidgetNode s e

The created text dropdown.

Creates a text dropdown using the given lens. Takes a function for converting the type to Text. Accepts config.

textDropdownV Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, TextShow a) 
=> a

The current value.

-> (a -> e)

The event to raise on change.

-> t a

The list of items.

-> WidgetNode s e

The created text dropdown.

Creates a text dropdown using the given value and onChange event handler.

textDropdownV_ Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a) 
=> a

The current value.

-> (a -> e)

The event to raise on change.

-> t a

The list of items.

-> (a -> Text)

The function for converting to Text.

-> [DropdownCfg s e a]

The config options.

-> WidgetNode s e

The created text dropdown.

Creates a text dropdown using the given value and onChange event handler. Takes a function for converting the type to Text. Accepts config.

textDropdownS Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, Show a) 
=> ALens' s a

The lens into the model.

-> t a

The list of items.

-> WidgetNode s e

The created text dropdown.

Creates a text dropdown using the given lens. The type must have a Show instance.

textDropdownS_ Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, Show a) 
=> ALens' s a

The lens into the model.

-> t a

The list of items.

-> [DropdownCfg s e a]

The config options.

-> WidgetNode s e

The created text dropdown.

Creates a text dropdown using the given lens. The type must have a Show instance. Accepts config.

textDropdownSV Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, Show a) 
=> a

The current value.

-> (a -> e)

The event to raise on change.

-> t a

The list of items.

-> WidgetNode s e

The created text dropdown.

Creates a text dropdown using the given value and onChange event handler. The type must have a Show instance.

textDropdownSV_ Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, Show a) 
=> a

The current value.

-> (a -> e)

The event to raise on change.

-> t a

The list of items.

-> [DropdownCfg s e a]

The config options.

-> WidgetNode s e

The created text dropdown.

Creates a text dropdown using the given value and onChange event handler. The type must have a Show instance. Accepts config.