diff --git a/src/Mtlstats/Menu.hs b/src/Mtlstats/Menu.hs index a910ca8..7385909 100644 --- a/src/Mtlstats/Menu.hs +++ b/src/Mtlstats/Menu.hs @@ -38,8 +38,10 @@ import Mtlstats.Types import Mtlstats.Types.Menu -- | The draw function for a 'Menu' -drawMenu :: Menu a -> C.Update () -drawMenu = C.drawString . show +drawMenu :: Menu a -> C.Update C.CursorMode +drawMenu m = do + C.drawString $ show m + return C.CursorInvisible -- | The event handler for a 'Menu' menuHandler :: Menu a -> C.Event -> Action a diff --git a/src/Mtlstats/UI.hs b/src/Mtlstats/UI.hs index c73962d..7e6ecc8 100644 --- a/src/Mtlstats/UI.hs +++ b/src/Mtlstats/UI.hs @@ -21,6 +21,7 @@ along with this program. If not, see . module Mtlstats.UI (draw) where +import Control.Monad (void) import Lens.Micro ((^.)) import qualified UI.NCurses as C @@ -30,8 +31,9 @@ import Mtlstats.Types -- | Drawing function draw :: ProgState -> C.Curses () draw s = do + void $ C.setCursorMode C.CursorInvisible w <- C.defaultWindow - C.updateWindow w $ do + cm <- C.updateWindow w $ do C.clear case s ^. progMode of MainMenu -> drawMenu mainMenu @@ -40,3 +42,4 @@ draw s = do | null $ gs ^. gameType -> drawMenu gameTypeMenu | otherwise ->undefined C.render + void $ C.setCursorMode cm