monomer-1.5.1.0: 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.Containers.Alert

Description

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

Configuration

data AlertCfg Source #

Configuration options for alert:

Constructors

alert Source #

Arguments

:: (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.

alert_ Source #

Arguments

:: (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.

alertMsg Source #

Arguments

:: (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.

alertMsg_ Source #

Arguments

:: (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.