Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv16051/gio/src/examples/simple
Added Files:
Able.hs
Log Message:
This commit implements instances for Able type class for all kinds of windows and controls.
--- NEW FILE: Able.hs ---
module Main where
import Graphics.UI.GIO
main = start "Able" SDI [] demo
demo = do
w1 <- window [title =: "Slave", view =: sz 200 100, domain =: sz 200 80]
ent <- entry [text =: "Test!"] w1
btn <- button [text =: "Button"] w1
set w1 [layout =: (hfix 80 ent <<< btn)]
w2 <- window [title =: "Master", view =: sz 200 80, domain =: sz 200 80]
bctrl <- button [] w2
bwnd <- button [] w2
set w2 [layout =: (hfill bctrl ^^^ hfill bwnd)]
enable "Control" bctrl ent
enable "Window" bwnd w1
return ()
where
enable title b w = do
set w [enabled =: True]
set b [text =: "Disable " ++ title, on command =: disable title b w]
disable title b w = do
set w [enabled =: False]
set b [text =: "Enable " ++ title, on command =: enable title b w]
|