The library application abstraction. Your application's operations
are provided in an App and then the App is provided to one of the
various main functions in this module. An application App s e n
is in terms of an application state type s, an application event
type e, and a resource name type n. In the simplest case e is
unused (left polymorphic or set to ()), but you may define your own
event type and use customMain to provide custom events. The state
type s is the type of application state to be provided by you and
iteratively modified by event handlers. The resource name type n
is the type of names you can assign to rendering resources such as
viewports and cursor locations. Your application must define this
type.
Constructors
AppappDraw :: s -> [Widget n]This function turns your application state into a list of widget layers. The layers are listed topmost first.
appChooseCursor :: s -> [CursorLocation n] -> Maybe (CursorLocation n)This function chooses which of the zero or more cursor locations reported by the rendering process should be selected as the one to use to place the cursor. If this returns Nothing, no cursor is placed. The rationale here is that many widgets may request a cursor placement but your application state is what you probably want to use to decide which one wins.
appHandleEvent :: BrickEvent n e -> EventM n s ()This function handles an event and updates the current application state.
appStartEvent :: EventM n s ()This function gets called once just prior to the first drawing of your application. Here is where you can make initial scrolling requests, for example.
appAttrMap :: s -> AttrMapThe attribute map that should be used during rendering.