Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv18788
Modified Files:
SimpleDialog.hs
Log Message:
More complicated example
Index: SimpleDialog.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleDialog.hs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SimpleDialog.hs 7 Oct 2003 21:39:31 -0000 1.3
--- SimpleDialog.hs 17 Oct 2003 09:00:17 -0000 1.4
***************
*** 11,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))]
(if b then runDialog else showWindow) d
!
--- 11,29 ----
showDialog b parent = do
d <- dialog [title =: "Dialog", frame =: Rect 100 100 500 500] parent
! grp <- groupBox [title =: "Open dialog"] d
! b1 <- button [title =: "Modal", on command =: showDialog True (Just d)] grp
! b2 <- button [title =: "Modeless", on command =: showDialog False (Just d)] grp
! set grp [layout =: pad 10 (b1 <<<< b2)]
! chk <- checkBox [title =: "Resizeable", checked =: True, on command =: setResizeableOnOff d] d
! bclr <- button [title =: "Set Color", on command =: setColor d] d
! set d [layout =: pad 10 (center (grp ^^^^ (chk <<<< bclr)))]
(if b then runDialog else showWindow) d
! where
! setResizeableOnOff d = do
! b <- get d resizeable
! set d [resizeable =: not b]
! setColor d = do
! mb_color <- runColorDialog (Just d)
! case mb_color of
! Just c -> set d [bgcolor =: c]
! Nothing -> return ()
|