InputMsg, inputMsg, et al

Types for messages from data entry fields

Types

data InputMsg a = InputChange a | InputDone KeySym a
  instance (Eq a) => Eq (InputMsg a)
  instance (Ord a) => Ord (InputMsg a)
  instance (Show a) => Show (InputMsg a)
inputMsg :: a -> InputMsg a
inputChange :: a -> InputMsg a
stripInputMsg :: InputMsg a -> a
tstInp :: (a -> b) -> InputMsg a -> b
mapInp :: (a -> b) -> InputMsg a -> InputMsg b
inputDone :: InputMsg a -> Maybe a
inputLeaveDone :: InputMsg a -> Maybe a
inputChange :: a -> InputMsg a

type KeySym = String

Description

Fudgets that allow users to edit values of type a output messages of type InputMsg a. The message indicates whether it contains an intermediate or final value. The user usually indicates that a value is complete by pressing the Enter or Return key on the keyboard.

stripInputMsg extracts the contents of an input message.

tstInp applies a function to the contents of an InputMsg.

mapInp modifies the contents of an InputMsg.

inputDone allows you to check if an InputMsg signals that the user is done and if so extact the contents.

inputLeaveDone allows you to check if an InputMsg signals that the user is done or has left the input field and if so extact the contents.

inputChange constructs an InputMsg that signals a change to the input. inputMsg constructs an InputMsg that indicates that the input is complete.

Example

 stripInputMsg >^=< stringF

Bugs

InputMsg should be an abstract type.

See Also

Stream processors manipulating InputMsgs: stripInputSP, inputDoneSP, inputLeaveDoneSP.

Fudgets that use InputMsgs: stringF, inputPopupF, inputPairF.