inputPopupF

Types

inputPopupF :: String -> F a (InputMsg b) -> Maybe b -> F (Maybe String, Maybe a) ((Maybe String, Maybe a), b)

Synopsis

inputPopupF title fudget default

Description

inputPopupF is a general dialog popup fudget. An argument fudget determines what kind of dialog is created. The popup window contains an explanatory message, whatever the argument fudget shows, an OK button and a Cancel button.

Input

Input messages are pairs of an optional prompt and and optional message to the argument fudget. One or both of these can be Nothing. Sending a message to inputPopupF causes the window to appear on the screen.

Output

The latest value received from the argument fudget is output when the OK button is pressed, paired with the latest input. Nothing is output if the cancel button is pressed. The window disappears when one of the buttons is pressed.

Arguments

title :: String
The window title. Appears in the title bar attached to the window by the window manager.
fudget :: F a (InputMsg b)
A fudget which allows the user to input some value. As a degenerate case, it can also just show some information that the user must confirm or cancel.

default :: Maybe b
Default value that will be output if the user immediately presses Ok. If the argument is Nothing, the user must supply a value, i.e., there is no default.

Example

 inputPopupF "File Picker" filePickF Nothing

See Also

Popup dialogs derived from inputPopupF: messagePopupF, confirmPopupF, stringPopupF, passwdPopupF.

Other related combinators: popupShellF, filePickF, stringF.