ltk-0.10.0.4: Leksah tool kitSource codeContentsIndex
Graphics.UI.Editor.Basics
Contents
Types
Description
Module for the basiscs of composing GUIs from editors
Synopsis
type Getter alpha beta = alpha -> beta
type Setter alpha beta = beta -> alpha -> alpha
type Injector beta = beta -> IO ()
type Extractor beta = IO (Maybe beta)
type Applicator beta gamma = beta -> gamma ()
type Editor alpha = Parameters -> Notifier -> IO (Widget, Injector alpha, Extractor alpha)
getStandardRegFunction :: GUIEventSelector -> GtkRegFunc
emptyNotifier :: IO Notifier
data GUIEvent = GUIEvent {
selector :: GUIEventSelector
gtkEvent :: Event
eventText :: String
gtkReturn :: Bool
}
data GUIEventSelector
= FocusOut
| FocusIn
| ButtonPressed
| KeyPressed
| Clicked
| MayHaveChanged
| ValidationError
type GtkRegFunc = forall o. GObjectClass o => o -> GtkHandler -> IO Connection
newtype Notifier = Noti (IORef (Handlers GUIEvent IO GUIEventSelector, Map GUIEventSelector GUIEventReg))
type GtkHandler = Event -> IO Bool
data Connection = forall alpha . GObjectClass alpha => ConnectC (ConnectId alpha)
type Connections = [Connection]
activateEvent :: GObjectClass o => o -> Notifier -> Maybe (o -> GtkHandler -> IO Connection) -> GUIEventSelector -> IO ()
propagateEvent :: Notifier -> [Notifier] -> GUIEventSelector -> IO ()
allGUIEvents :: [GUIEventSelector]
genericGUIEvents :: [GUIEventSelector]
propagateAsChanged :: EventSource alpha GUIEvent m GUIEventSelector => alpha -> [GUIEventSelector] -> m ()
Types
type Getter alpha beta = alpha -> betaSource
A type for getting a field of a record
type Setter alpha beta = beta -> alpha -> alphaSource
A type for setting the field of a record
type Injector beta = beta -> IO ()Source
A type for injecting a value into an editor
type Extractor beta = IO (Maybe beta)Source
A type for extracting a value from an editor
type Applicator beta gamma = beta -> gamma ()Source
A type for the application of a value to be reflected in the GUI
type Editor alpha = Parameters -> Notifier -> IO (Widget, Injector alpha, Extractor alpha)Source
A type to describe an editor. alpha is the type of the individual field of the record
getStandardRegFunction :: GUIEventSelector -> GtkRegFuncSource
A convinence method for not repeating this over and over again
emptyNotifier :: IO NotifierSource
data GUIEvent Source
A type for an event in the GUI
Constructors
GUIEvent
selector :: GUIEventSelector
gtkEvent :: Event
eventText :: String
gtkReturn :: BoolTrue means that the event has been completely handled, gtk shoudn't do any further action about it (Often not a good idea
show/hide Instances
data GUIEventSelector Source
Constructors
FocusOutgeneric, the widget looses the focus
FocusIngeneric, the widget gets the focus
ButtonPressedgeneric, a mouse key has been pressed and released, while the widget has the focus
KeyPressedgeneric, a keyboard key has been pressed and released, while the widget has the focus
Clickedbutton specific, the button has been pressed
MayHaveChangedgeneric, no gui event, the contents of the widget may have changed
ValidationErrorvalidation of a contents has failed
show/hide Instances
type GtkRegFunc = forall o. GObjectClass o => o -> GtkHandler -> IO ConnectionSource
A type for a function to register a gtk event |
newtype Notifier Source
The event source in the gtk editor context If the second argument is Left Handler the handler gets registered If the second argument is Right Unique the handler will be removed The returned unique value must be used for unregistering an event
Constructors
Noti (IORef (Handlers GUIEvent IO GUIEventSelector, Map GUIEventSelector GUIEventReg))
show/hide Instances
type GtkHandler = Event -> IO BoolSource
data Connection Source
Signal handlers for the different pane types
Constructors
forall alpha . GObjectClass alpha => ConnectC (ConnectId alpha)
show/hide Instances
type Connections = [Connection]Source
activateEvent :: GObjectClass o => o -> Notifier -> Maybe (o -> GtkHandler -> IO Connection) -> GUIEventSelector -> IO ()Source
Activate the event after the event has been declared and the widget has been constructed
propagateEvent :: Notifier -> [Notifier] -> GUIEventSelector -> IO ()Source
Propagate the event with the selector from notifier to eventSource
allGUIEvents :: [GUIEventSelector]Source
genericGUIEvents :: [GUIEventSelector]Source
propagateAsChanged :: EventSource alpha GUIEvent m GUIEventSelector => alpha -> [GUIEventSelector] -> m ()Source
Produced by Haddock version 2.6.1