|
From: <kr_...@us...> - 2003-07-01 20:44:04
|
Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv29071/simple
Modified Files:
Able.hs ByeDemo.hs ConfirmQuit.hs SimpleDialog.hs
SimpleHello.hs SimpleQuitButton.hs
Log Message:
update samples
Index: Able.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/Able.hs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Able.hs 2 Apr 2003 21:33:55 -0000 1.4
--- Able.hs 1 Jul 2003 20:44:00 -0000 1.5
***************
*** 3,12 ****
import Graphics.UI.GIO
! main = start MDI [title =: "Able"] 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]
--- 3,12 ----
import Graphics.UI.GIO
! main = start "Able" "1.0" MDI [] demo
demo = do
w1 <- window [title =: "Slave", view =: sz 200 100, domain =: sz 200 80]
! ent <- entry [title =: "Test!"] w1
! btn <- button [title =: "Button"] w1
set w1 [layout =: (hfix 80 ent <<< btn)]
w2 <- window [title =: "Master", view =: sz 200 80, domain =: sz 200 80]
***************
*** 18,26 ****
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]
--- 18,26 ----
return ()
where
! enable name b w = do
set w [enabled =: True]
! set b [title =: "Disable " ++ name, on command =: disable name b w]
! disable name b w = do
set w [enabled =: False]
! set b [title =: "Enable " ++ name, on command =: enable name b w]
Index: ByeDemo.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/ByeDemo.hs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ByeDemo.hs 2 Apr 2003 21:33:55 -0000 1.4
--- ByeDemo.hs 1 Jul 2003 20:44:00 -0000 1.5
***************
*** 17,26 ****
import Graphics.UI.GIO
! main = start SDI [] demo -- "start" initializes the GUI.
demo :: IO ()
! demo = do w <- window [title =: "Bye!"]
! l <- label [text =: "Hello World"] w
! b <- button [text =: "Bye"] w
set w [layout =: pad 10 (center l ^^^^ center b)]
set b [on command =: bye l b]
--- 17,26 ----
import Graphics.UI.GIO
! main = start "Bye!" "1.0" SDI [] demo -- "start" initializes the GUI.
demo :: IO ()
! demo = do w <- window []
! l <- label [title =: "Hello World"] w
! b <- button [title =: "Bye"] w
set w [layout =: pad 10 (center l ^^^^ center b)]
set b [on command =: bye l b]
***************
*** 28,31 ****
-- called on the first click, with the window, label, and button as arguments.
bye l b
! = do set l [text =: "Goodbye"]
set b [on command =: halt]
--- 28,31 ----
-- called on the first click, with the window, label, and button as arguments.
bye l b
! = do set l [title =: "Goodbye"]
set b [on command =: halt]
Index: ConfirmQuit.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/ConfirmQuit.hs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ConfirmQuit.hs 2 Apr 2003 21:33:55 -0000 1.3
--- ConfirmQuit.hs 1 Jul 2003 20:44:00 -0000 1.4
***************
*** 5,11 ****
main
! = start SDI [] $
! do w <- window [title =: "hello world"
! ,view =: sz 200 200]
set w [on dismiss =: confirmQuit w]
where
--- 5,10 ----
main
! = start "ConfirmQuit" "1.0" SDI [] $
! do w <- window [view =: sz 200 200]
set w [on dismiss =: confirmQuit w]
where
Index: SimpleDialog.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleDialog.hs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SimpleDialog.hs 26 Apr 2003 20:23:15 -0000 1.1
--- SimpleDialog.hs 1 Jul 2003 20:44:00 -0000 1.2
***************
*** 5,9 ****
main
! = start SDI [title =: "Simple dialogs"] $ do
fm <- menu [title =: "&Open"] mainMenu
menuitem [title =: "Modal Dialog", on command =: showDialog True Nothing] fm
--- 5,9 ----
main
! = start "Simple dialogs" "1.0" SDI [] $ do
fm <- menu [title =: "&Open"] mainMenu
menuitem [title =: "Modal Dialog", on command =: showDialog True Nothing] fm
***************
*** 12,17 ****
showDialog b parent = do
d <- dialog [title =: "Dialog", frame =: Rect 100 100 500 500] parent
! b1 <- button [text =: "Open Modal Dialog", on command =: showDialog True (Just d)] d
! b2 <- button [text =: "Open Modeless Dialog", on command =: showDialog False (Just d)] d
set d [layout =: pad 10 (center (b1 <<< b2))]
when b (runDialog d)
--- 12,17 ----
showDialog b parent = do
d <- dialog [title =: "Dialog", frame =: Rect 100 100 500 500] parent
! b1 <- button [title =: "Open Modal Dialog", on command =: showDialog True (Just d)] d
! b2 <- button [title =: "Open Modeless Dialog", on command =: showDialog False (Just d)] d
set d [layout =: pad 10 (center (b1 <<< b2))]
when b (runDialog d)
Index: SimpleHello.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleHello.hs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SimpleHello.hs 2 Apr 2003 21:33:55 -0000 1.3
--- SimpleHello.hs 1 Jul 2003 20:44:00 -0000 1.4
***************
*** 4,7 ****
main
! = start SDI [] $
! do window [title =: "hello world", view =: sz 200 200]
--- 4,7 ----
main
! = start "hello world" "1.0" SDI [] $
! do window [view =: sz 200 200]
Index: SimpleQuitButton.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleQuitButton.hs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SimpleQuitButton.hs 2 Apr 2003 21:33:55 -0000 1.3
--- SimpleQuitButton.hs 1 Jul 2003 20:44:00 -0000 1.4
***************
*** 3,10 ****
import Graphics.UI.GIO
! main = start SDI [] demo
demo :: IO ()
! demo = do w <- window [title =: "Quit demo"]
! q <- button [text =: "Quit", on command =: halt] w
set w [layout =: pad 10 (center q)]
--- 3,10 ----
import Graphics.UI.GIO
! main = start "Quit demo" "1.0" SDI [] demo
demo :: IO ()
! demo = do w <- window []
! q <- button [title =: "Quit", on command =: halt] w
set w [layout =: pad 10 (center q)]
|