implemented menuControllerWith

This commit is contained in:
Jonathan Lamothe 2019-11-11 20:52:56 -05:00
parent e1f92ce92e
commit d14abdb248

View File

@ -59,12 +59,7 @@ import Mtlstats.Util
-- | Generates a simple 'Controller' for a Menu
menuController :: Menu () -> Controller
menuController menu = Controller
{ drawController = const $ drawMenu menu
, handleController = \e -> do
menuHandler menu e
return True
}
menuController = menuControllerWith $ const $ return ()
-- | Generate a simple 'Controller' for a 'Menu' with a header
menuControllerWith
@ -74,7 +69,14 @@ menuControllerWith
-- ^ The menu
-> Controller
-- ^ The resulting controller
menuControllerWith = undefined
menuControllerWith header menu = Controller
{ drawController = \s -> do
header s
drawMenu menu
, handleController = \e -> do
menuHandler menu e
return True
}
-- | The draw function for a 'Menu'
drawMenu :: Menu a -> C.Update C.CursorMode