on master help sign in
Update the example in Graphics.Vty
83c2203Eric Mertens
src/Graphics/Vty.hs+8−5
@@ -14,16 +14,19 @@
14-- See the vty-examples package for a number of examples.
14-- See the vty-examples package for a number of examples.
15--
15--
16-- @
16-- @
17+-- import "Graphics.Vty"
18+--
17-- main = do
19-- main = do
20+-- cfg <- 'standardIOConfig'
18−-- vty <- 'mkVty' def
21+-- vty <- 'mkVty' cfg
19−-- let line0 = 'string' (def `withForeColor` 'green') \"first line\"
22+-- let line0 = 'string' ('defAttr' ` 'withForeColor' ` 'green') \"first line\"
20−-- line1 = 'string' (def `withBackColor` 'blue') \"second line\"
23+-- line1 = 'string' ('defAttr' ` 'withBackColor' ` 'blue') \"second line\"
21-- img = line0 '<->' line1
24-- img = line0 '<->' line1
22-- pic = 'picForImage' img
25-- pic = 'picForImage' img
23-- 'update' vty pic
26-- 'update' vty pic
24−-- e :: 'Event' <- 'nextEvent' vty
27+-- e <- 'nextEvent' vty
25-- 'shutdown' vty
28-- 'shutdown' vty
26−-- print $ \"Last event was: \" ++ show e
29+-- 'print' (\"Last event was: \" '++' 'show' e)
27-- @
30-- @
28--
31--
29-- Good sources of documentation for terminal programming are:
32-- Good sources of documentation for terminal programming are: