monomer-1.5.0.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.Confirm

Description

Simple confirm dialog, displaying accept and close buttons and optional title. Usually embedded in a zstack component and displayed/hidden depending on context.

Similar to Monomer.Widgets.Containers.Alert, but takes two events to handle the Accept and Cancel actions.

A simple text message can be displayed with confirmMsg, providing the message text and the events to generate when the user interacts with the dialog:

confirmMsg "Save changes?" ConfirmAcceptEvent ConfirmCancelEvent

Alternatively, a custom widget can be provided to display as content:

customConfirm = confirm ConfirmAcceptEvent ConfirmCancelEvent where
  content = hstack [
      label "Save changes?",
      filler,
      label fileName
    ]
Synopsis

Configuration

data ConfirmCfg Source #

Configuration options for confirm:

data InnerConfirmEvt e Source #

Wraps the user event to be able to implement custom events and still be able to report to its parent.

Previously used, now kept for reference.

Instances

Instances details
Show e => Show (InnerConfirmEvt e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Confirm

Eq e => Eq (InnerConfirmEvt e) Source # 
Instance details

Defined in Monomer.Widgets.Containers.Confirm

Constructors

confirm Source #

Arguments

:: (WidgetModel s, WidgetEvent e) 
=> e

The accept button event.

-> e

The cancel button event.

-> WidgetNode () (InnerConfirmEvt e)

Content to display in the dialog.

-> WidgetNode s e

The created dialog.

Creates a confirm dialog with the provided content.

confirm_ Source #

Arguments

:: (WidgetModel s, WidgetEvent e) 
=> e

The accept button event.

-> e

The cancel button event.

-> [ConfirmCfg]

The config options for the dialog.

-> WidgetNode () (InnerConfirmEvt e)

Content to display in the dialog.

-> WidgetNode s e

The created dialog.

Creates an alert dialog with the provided content. Accepts config.

confirmMsg Source #

Arguments

:: (WidgetModel s, WidgetEvent e) 
=> Text

The message to display in the dialog.

-> e

The accept button event.

-> e

The cancel button event.

-> WidgetNode s e

The created dialog.

Creates an alert dialog with a text message as content.

confirmMsg_ Source #

Arguments

:: (WidgetModel s, WidgetEvent e) 
=> Text

The message to display in the dialog.

-> e

The accept button event.

-> e

The cancel button event.

-> [ConfirmCfg]

The config options for the dialog.

-> WidgetNode s e

The created dialog.

Creates an alert dialog with a text message as content. Accepts config.