Safe Haskell | None |
---|---|
Language | Haskell2010 |
UI.App
Contents
Synopsis
- drawUI :: AppState -> [Widget Name]
- renderWidget :: AppState -> ViewName -> Name -> Widget Name
- handleViewEvent :: ViewName -> Name -> AppState -> Event -> EventM Name (Next AppState)
- appEvent :: AppState -> BrickEvent Name PurebredEvent -> EventM Name (Next AppState)
- initialState :: InternalConfiguration -> IO AppState
- theApp :: AppState -> App AppState PurebredEvent Name
Synopsis
This module ties in all functions for rendering and handling events.
Differences to Brick
Purebred uses Brick widgets, but in order to make Purebred
configurable, we've made changes to how we use Brick. The single
difference to Brick is found on how we process keys (see
Keybindings
). Brick handles keys directly in the
widget. Purebred instead looks up keybindings first. If nothing
matches, the key is forwarded to the widget.
drawUI :: AppState -> [Widget Name] Source #
Main UI drawing function. Looks up which widgets need to be
rendered in the current View
and traverses each layer pattern
matching the ViewName
and widget Name
in renderWidget
to draw
the widget.
handleViewEvent :: ViewName -> Name -> AppState -> Event -> EventM Name (Next AppState) Source #
Main event handler
Handling of application events. These can be keys which are pressed by the user or asynchronous events send by threads.
initialState :: InternalConfiguration -> IO AppState Source #