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.ToggleButton

Description

Toggle button widget, used for boolean values.

toggleButton "Toggle" booleanLens

Its behavior is equivalent to Monomer.Widgets.Singles.Checkbox and Monomer.Widgets.Singles.LabeledCheckbox, with a different visual representation.

See Monomer.Widgets.Singles.OptionButton for detailed notes.

Synopsis

Configuration

type ToggleButtonCfg s e = OptionButtonCfg s e Bool Source #

Configuration options for toggleButton:

toggleButtonOffStyle :: Style -> ToggleButtonCfg s e Source #

Sets the style for the Off state of the toggle button.

Constructors

toggleButton Source #

Arguments

:: Text

The caption.

-> ALens' s Bool

The lens into the model.

-> WidgetNode s e

The created toggle button.

Creates a toggleButton using the given lens.

toggleButton_ Source #

Arguments

:: Text

The caption.

-> ALens' s Bool

The lens into the model.

-> [ToggleButtonCfg s e]

The config options.

-> WidgetNode s e

The created toggle button.

Creates a toggleButton using the given lens. Accepts config.

toggleButtonV Source #

Arguments

:: WidgetEvent e 
=> Text

The caption.

-> Bool

The current value.

-> (Bool -> e)

The event to raise on change.

-> WidgetNode s e

The created toggle button.

Creates a toggleButton using the given value and onChange event handler.

toggleButtonV_ Source #

Arguments

:: WidgetEvent e 
=> Text

The caption.

-> Bool

The current value.

-> (Bool -> e)

The event to raise on change.

-> [ToggleButtonCfg s e]

The config options.

-> WidgetNode s e

The created toggle button.

Creates a toggleButton using the given value and onChange event handler. Accepts config.

toggleButtonD_ Source #

Arguments

:: Text

The caption.

-> WidgetData s Bool

The WidgetData to retrieve the value from.

-> [ToggleButtonCfg s e]

The config options.

-> WidgetNode s e

The created toggle button.

Creates a toggleButton providing a WidgetData instance and config.