Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv13234
Added Files:
Counter.hs
Log Message:
Add Counter example (ported from ObjectIO)
--- NEW FILE: Counter.hs ---
module Main (main) where
import Graphics.UI.GIO
main = start "Counter" "1.0" SDI [] $ do
w <- window []
ent <- entry [readOnly =: True, tooltip =: "Counter Value", title =: "0"] w
bplus <- button [title =: "-", tooltip =: "Decrement Value", on command =: upd (\x->x-1) ent] w
bminus <- button [title =: "+", tooltip =: "Increment Value", on command =: upd (\x->x+1) ent] w
set w [layout =: hfill ent ^^^ hcenter (pad 5 (fill bplus <<< fill bminus))]
where
upd f ent = set ent [title ~: show . f . read]
|