Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Core glue for running an application.
Synopsis
- type AppEventResponse s e = EventResponse s e s ()
- type AppEventHandler s e = WidgetEnv s e -> WidgetNode s e -> s -> e -> [AppEventResponse s e]
- type AppUIBuilder s e = UIBuilder s e
- startApp :: (Eq s, WidgetModel s, WidgetEvent e) => s -> AppEventHandler s e -> AppUIBuilder s e -> [AppConfig e] -> IO ()
Documentation
type AppEventResponse s e = EventResponse s e s () Source #
Type of response an App event handler can return, with s being the model and e the user's event type.
type AppEventHandler s e Source #
= WidgetEnv s e | The widget environment. |
-> WidgetNode s e | The root node of the application. |
-> s | The application's model. |
-> e | The event to handle. |
-> [AppEventResponse s e] | The list of requested actions. |
Type of an App event handler.
type AppUIBuilder s e = UIBuilder s e Source #
Type of the function responsible of creating the App UI.
:: (Eq s, WidgetModel s, WidgetEvent e) | |
=> s | The initial model. |
-> AppEventHandler s e | The event handler. |
-> AppUIBuilder s e | The UI builder. |
-> [AppConfig e] | The application config. |
-> IO () | The application action. |
Runs an application, creating the UI with the provided function and initial model, handling future events with the event handler.
Control will not be returned until the UI exits. This needs to be ran in the main thread if using macOS.