| 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 |
Monomer.Widgets.Singles.Radio
Contents
Description
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](Monomer.Widgets.Containers.Stack)). 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:WidgetRequestto generate when focus is received.onBlur: event to raise when focus is lost.onBlurReq:WidgetRequestto generate when focus is lost.onClick: event to raise when the value is clicked.onClickReq:WidgetRequestto generate when the value is clicked.onChange: event to raise when the value changes.onChangeReq:WidgetRequestto generate when the value changes.
Instances
Constructors
Arguments
| :: (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.
Arguments
| :: (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.
Arguments
| :: (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.
Arguments
| :: (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.
Arguments
| :: (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.