diff options
| author | Akshay Nair <phenax5@gmail.com> | 2024-12-24 22:28:38 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2024-12-24 22:42:34 +0530 |
| commit | 459488a2e777380fcb65e3b4dd355fe525ff77ca (patch) | |
| tree | bd21b71b73fc627d37e91e7800dd514706e49942 /src/Chelleport/AppShell.hs | |
| parent | 70e3920556496e5fecb5fedddf1067b2522fcac7 (diff) | |
| download | chelleport-459488a2e777380fcb65e3b4dd355fe525ff77ca.tar.gz chelleport-459488a2e777380fcb65e3b4dd355fe525ff77ca.zip | |
Add search mode for text based searching with ocr
Diffstat (limited to 'src/Chelleport/AppShell.hs')
| -rw-r--r-- | src/Chelleport/AppShell.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Chelleport/AppShell.hs b/src/Chelleport/AppShell.hs index ba31982..2e95a85 100644 --- a/src/Chelleport/AppShell.hs +++ b/src/Chelleport/AppShell.hs @@ -35,18 +35,19 @@ type EventHandler state appAction = state -> SDL.Event -> Maybe appAction type View m state = state -> m () -type Initializer m state = m state +type Initializer m state appAction = m (state, Maybe appAction) setupAppShell :: (MonadIO m) => DrawContext -> - Initializer m state -> + Initializer m state appAction -> Update m state appAction -> EventHandler state appAction -> View m state -> m () -setupAppShell (DrawContext {ctxRenderer = renderer}) getInitState update eventHandler draw = - getInitState >>= appLoop +setupAppShell (DrawContext {ctxRenderer = renderer}) getInitState update eventHandler draw = do + state <- getInitState >>= evalUpdateResult + appLoop state where appLoop currentState = do SDL.rendererDrawColor renderer $= colorBackground |
