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

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 :: (MonadIO m, Show a) => Widget a -> String -> m (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 :: MonadIO m => Dialog -> (Dialog -> IO ()) -> m ()Source

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

onDialogCancel :: MonadIO m => Dialog -> (Dialog -> IO ()) -> m ()Source

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

acceptDialog :: MonadIO m => Dialog -> m ()Source

Programmatically accept the dialog.

cancelDialog :: MonadIO m => Dialog -> m ()Source

Programmatically cancel the dialog.