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 |
Simple alert dialog, displaying a close button and optional title. Usually embedded in a zstack component and displayed/hidden depending on context.
A simple text message can be displayed with alertMsg
, providing the message
text and the event to generate when the user closes the alert:
alertMsg "En error occurred" AlertClosedEvent
Alternatively, a custom widget can be provided to display as content:
customAlert = alert AlertClosedEvent content where content = hstack [ label "Error:", filler, label errorDescription ]
Synopsis
- data AlertCfg
- alert :: (WidgetModel s, WidgetEvent e) => e -> WidgetNode () e -> WidgetNode s e
- alert_ :: (WidgetModel s, WidgetEvent e) => e -> [AlertCfg] -> WidgetNode () e -> WidgetNode s e
- alertMsg :: (WidgetModel s, WidgetEvent e) => Text -> e -> WidgetNode s e
- alertMsg_ :: (WidgetModel s, WidgetEvent e) => Text -> e -> [AlertCfg] -> WidgetNode s e
Configuration
Configuration options for alert:
titleCaption
: the title of the alert dialog.closeCaption
: the caption of the close button.
Instances
Monoid AlertCfg Source # | |
Semigroup AlertCfg Source # | |
Default AlertCfg Source # | |
Defined in Monomer.Widgets.Containers.Alert | |
CmbCloseCaption AlertCfg Source # | |
Defined in Monomer.Widgets.Containers.Alert closeCaption :: Text -> AlertCfg Source # | |
CmbTitleCaption AlertCfg Source # | |
Defined in Monomer.Widgets.Containers.Alert titleCaption :: Text -> AlertCfg Source # |
Constructors
:: (WidgetModel s, WidgetEvent e) | |
=> e | The event to raise when the dialog is closed. |
-> WidgetNode () e | The content to display in the dialog. |
-> WidgetNode s e | The created dialog. |
Creates an alert dialog with the provided content.
:: (WidgetModel s, WidgetEvent e) | |
=> e | The event to raise when the dialog is closed. |
-> [AlertCfg] | The config options for the dialog. |
-> WidgetNode () e | The content to display in the dialog. |
-> WidgetNode s e | The created dialog. |
Creates an alert dialog with the provided content. Accepts config.
:: (WidgetModel s, WidgetEvent e) | |
=> Text | The message to display. |
-> e | The event to raise when the dialog is closed. |
-> WidgetNode s e | The created dialog. |
Creates an alert dialog with a text message as content.
:: (WidgetModel s, WidgetEvent e) | |
=> Text | The message to display. |
-> e | The event to raise when the dialog is closed. |
-> [AlertCfg] | The config options for the dialog. |
-> WidgetNode s e | The created dialog. |
Creates an alert dialog with a text message as content. Accepts config.