Module for the basiscs of composing GUIs from editors
- 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 {}
- data GUIEventSelector
- = Clicked
- | FocusOut
- | FocusIn
- | SelectionChanged
- | ButtonRelease
- | AfterKeyRelease
- type GtkRegFunc = Widget -> GtkHandler -> IO (ConnectId Widget)
- newtype Notifier = Noti (IORef (Handlers GUIEvent IO GUIEventSelector, Map GUIEventSelector GUIEventReg))
- type GtkHandler = Event -> IO Bool
- activateEvent :: Widget -> Notifier -> Maybe GtkRegFunc -> GUIEventSelector -> IO ()
- propagateEvent :: Notifier -> [Notifier] -> GUIEventSelector -> IO ()
- allGUIEvents :: [GUIEventSelector]
Types
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
A type for an event in the GUI
GUIEvent | |
|
data GUIEventSelector Source
type GtkRegFunc = Widget -> GtkHandler -> IO (ConnectId Widget)Source
A type for a function to register a gtk event |
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
Noti (IORef (Handlers GUIEvent IO GUIEventSelector, Map GUIEventSelector GUIEventReg)) |
type GtkHandler = Event -> IO BoolSource
activateEvent :: Widget -> Notifier -> Maybe GtkRegFunc -> 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