ยค inputPopupF

Pop-up windows

Types

inputPopupF :: String ->
               InF a c -> Maybe c -> F (Maybe String, Maybe a) ((Maybe String, Maybe a), c)

Synopsis

inputPopupF title fudget default

type InF a b = F a (InputMsg b)

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 :: InF a c
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 c
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.

Fudget used to implement inputPopupF: popupShellF.

Fudgets useful in dialog popups: filePickF, stringF.

Composing dialogs elements: inputPairF et al.