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.
- data Dialog
- newDialog :: (MonadIO m, Show a) => Widget a -> String -> m (Dialog, Widget FocusGroup)
- onDialogAccept :: MonadIO m => Dialog -> (Dialog -> IO ()) -> m ()
- onDialogCancel :: MonadIO m => Dialog -> (Dialog -> IO ()) -> m ()
- acceptDialog :: MonadIO m => Dialog -> m ()
- cancelDialog :: MonadIO m => Dialog -> m ()
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.