-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.hs
37 lines (32 loc) · 803 Bytes
/
Main.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module Main where
import Brick
import Brick.BChan (newBChan, writeBChan)
import Control.Concurrent (forkIO, threadDelay)
import Control.Monad (forever, void)
import Graphics.Vty
import UIAttributes
import UIEvents
import UITypes
import UIWidgets
main :: IO ()
main = do
let buildVty = do
v <- mkVty =<< standardIOConfig
setMode (outputIface v) Mouse True
return v
chan <- newBChan 10
forkIO . forever $ do
writeBChan chan Tick
threadDelay 300000
initialVty <- buildVty
b <- initUIState
void $ customMain initialVty buildVty (Just chan) app b
app :: App UIState Tick Name
app =
App
{ appDraw = renderUI,
appChooseCursor = neverShowCursor,
appHandleEvent = handleEvent,
appStartEvent = return,
appAttrMap = const theMap
}