Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv23833
Added Files:
SimpleDialog.hs
Log Message:
Add dialogs sample
--- NEW FILE: SimpleDialog.hs ---
module Main where
import Graphics.UI.GIO
import Control.Monad(when)
main
= start SDI [title =: "Simple dialogs"] $ do
fm <- menu [title =: "&Open"] mainMenu
menuitem [title =: "Modal Dialog", on command =: showDialog True Nothing] fm
menuitem [title =: "Modeless Dialog", on command =: showDialog False Nothing] fm
where
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)
|