vty-ui-1.7: An interactive terminal user interface library for Vty

Safe HaskellNone

Graphics.Vty.Widgets.Dialog

Description

This module provides a simple ''dialog'' interface with an ''OK'' button and a ''Cancel'' button. The dialog itself is capable of embedding an arbitrary interface and it exposes ''accept'' and ''cancel'' events which are triggered by the dialog's buttons.

Synopsis

Documentation

newDialog :: Show a => Widget a -> Text -> IO (Dialog, Widget FocusGroup)Source

Create a new dialog with the specified embedded interface and title. Returns the dialog itself and the FocusGroup to which its buttons were added, for use in your application.

onDialogAccept :: Dialog -> (Dialog -> IO ()) -> IO ()Source

Register an event handler for the dialog's acceptance event.

onDialogCancel :: Dialog -> (Dialog -> IO ()) -> IO ()Source

Register an event handler for the dialog's cancellation event.

acceptDialog :: Dialog -> IO ()Source

Programmatically accept the dialog.

cancelDialog :: Dialog -> IO ()Source

Programmatically cancel the dialog.