Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Radio widget, used for interacting with a fixed set of values. Each instance of the radio is associated with a single value. It does not include text, which can be added with a label in the desired position (usually with hstack/vstack). Alternatively, Monomer.Widgets.Singles.LabeledRadio provides this functionality out of the box.
radio Option1 optionLens
Monomer.Widgets.Singles.OptionButton provides similar functionality but with the look of a regular button.
Synopsis
- type RadioValue a = (Eq a, Typeable a)
- data RadioCfg s e a
- radio :: (RadioValue a, WidgetEvent e) => a -> ALens' s a -> WidgetNode s e
- radio_ :: (RadioValue a, WidgetEvent e) => a -> ALens' s a -> [RadioCfg s e a] -> WidgetNode s e
- radioV :: (RadioValue a, WidgetEvent e) => a -> a -> (a -> e) -> WidgetNode s e
- radioV_ :: (RadioValue a, WidgetEvent e) => a -> a -> (a -> e) -> [RadioCfg s e a] -> WidgetNode s e
- radioD_ :: (RadioValue a, WidgetEvent e) => a -> WidgetData s a -> [RadioCfg s e a] -> WidgetNode s e
Configuration
type RadioValue a = (Eq a, Typeable a) Source #
Constraints for numeric types accepted by the radio widget.
Configuration options for radio:
width
: sets the max width/height of the radio.onFocus
: event to raise when focus is received.onFocusReq
:WidgetRequest
to generate when focus is received.onBlur
: event to raise when focus is lost.onBlurReq
:WidgetRequest
to generate when focus is lost.onClick
: event to raise when the value is clicked.onClickReq
:WidgetRequest
to generate when the value is clicked.onChange
: event to raise when the value changes.onChangeReq
:WidgetRequest
to generate when the value changes.
Instances
Constructors
:: (RadioValue a, WidgetEvent e) | |
=> a | The option value. |
-> ALens' s a | The lens into the model. |
-> WidgetNode s e | The created radio. |
Creates a radio using the given lens.
:: (RadioValue a, WidgetEvent e) | |
=> a | The option value. |
-> ALens' s a | The lens into the model. |
-> [RadioCfg s e a] | The config options. |
-> WidgetNode s e | The created radio. |
Creates a radio using the given lens. Accepts config.
:: (RadioValue a, WidgetEvent e) | |
=> a | The option value. |
-> a | The current value. |
-> (a -> e) | The event to raise on change. |
-> WidgetNode s e | The created radio. |
Creates a radio using the given value and onChange
event handler.
:: (RadioValue a, WidgetEvent e) | |
=> a | The option value. |
-> a | The current value. |
-> (a -> e) | The event to raise on change. |
-> [RadioCfg s e a] | The config options. |
-> WidgetNode s e | The created radio. |
Creates a radio using the given value and onChange
event handler.
Accepts config.
:: (RadioValue a, WidgetEvent e) | |
=> a | The option value. |
-> WidgetData s a | The |
-> [RadioCfg s e a] | The config options. |
-> WidgetNode s e | The created radio. |
Creates a radio providing a WidgetData
instance and config.