vty/test/vty_issue_18.hs
coreyoconnor f6c3cbfa01 adding example of Graphics.Vty.Inline to test
Ignore-this: e82f6a3b8eec33ab55fd04a51f4d9873

darcs-hash:20091228233218-f0a0d-345ddcbee616acc4f39d9d12393bdea5982f34d9.gz
2009-12-28 15:32:18 -08:00

37 lines
764 B
Haskell

module Main
where
import Graphics.Vty
import Graphics.Vty.Debug
import System.IO
main :: IO ()
main = do
vty <- mkVty
(sx, sy) <- getSize vty
play vty sx sy
play :: Vty -> Int -> Int -> IO ()
play vty sx sy =
let
testScreen = pic {
pCursor = NoCursor
, pImage = box 10 10 }
in do
update vty testScreen
getEvent vty
shutdown vty
return ()
box :: Int -> Int -> Image
box w h =
let
corner = renderChar attr '+'
vertLine = renderFill attr '|' 1 (h - 2)
horizLine = corner <|> renderHFill attr '-' (w - 2) <|> corner
centerArea = vertLine <|> renderFill attr 'X' (w - 2) (h - 2) <|> vertLine
in
horizLine <-> centerArea <-> horizLine