Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv25251
Modified Files:
Calculator.hs
Log Message:
niceified the calculator example.
Index: Calculator.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/Calculator.hs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Calculator.hs 30 Jan 2003 23:49:56 -0000 1.1
--- Calculator.hs 31 Jan 2003 15:33:14 -0000 1.2
***************
*** 10,17 ****
calculator
= do varst <- newVar (0,id)
! w <- window [title =: "calculator", resizeable =: False]
display <- label [text =: "0"] w
keys <- mapM (\c -> button [text =: [c], on command =: cmd varst display c] w) "123+456-789*C0=/"
! set w [layout =: (pad 10 (hglue <<< display)) ^^^ grid (matrix 4 (map (hfix 40) keys))]
where
matrix n [] = []
--- 10,17 ----
calculator
= do varst <- newVar (0,id)
! w <- window [title =: "calculator", resizeable =: True]
display <- label [text =: "0"] w
keys <- mapM (\c -> button [text =: [c], on command =: cmd varst display c] w) "123+456-789*C0=/"
! set w [layout =: (pad 10 (hglue <<< display)) ^^^ grid (matrix 4 (map (hfix 50) keys))]
where
matrix n [] = []
|