From: <dl...@us...> - 2003-01-31 23:27:27
|
Update of /cvsroot/htoolkit/port/src/examples In directory sc8-pr-cvs1:/tmp/cvs-serv12489/src/examples Modified Files: ByeDemo.hs Log Message: more comments to the demo Index: ByeDemo.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/examples/ByeDemo.hs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ByeDemo.hs 31 Jan 2003 21:21:29 -0000 1.1 --- ByeDemo.hs 31 Jan 2003 23:27:24 -0000 1.2 *************** *** 21,41 **** registerWindowPaint w (\can upd -> fillRect upd can) -- fill the background with some color setWindowDomainSize w (Size 0 0) -- no scroll bars needed ! setWindowViewSize w (Size 80 40) -- guess some size as Port has no layout manager ! setWindowTitle w "Bye!" l <- createLabel w setLabelText l "Hello World!" ! lsize <- getLabelRequestSize l -- get minimal size moveResizeControl l (rectAt (Point 0 0) lsize) -- position in upperleft corner b <- createButton w setButtonText b "Bye" ! bsize <- getButtonRequestSize b moveResizeControl b (rectAt (Point 0 (sh lsize)) bsize) -- position under the label registerButtonClick b (bye w l b) -- register event handler ! showWindow w where bye w l b = do setLabelText l "Goodbye" ! registerButtonClick b (closeWindow w) --- 21,42 ---- registerWindowPaint w (\can upd -> fillRect upd can) -- fill the background with some color setWindowDomainSize w (Size 0 0) -- no scroll bars needed ! setWindowViewSize w (Size 80 40) -- guess some size as Port has no layout manager ! setWindowTitle w "Bye!" -- set the title bar text l <- createLabel w setLabelText l "Hello World!" ! lsize <- getLabelRequestSize l -- get the minimal size of the label moveResizeControl l (rectAt (Point 0 0) lsize) -- position in upperleft corner b <- createButton w setButtonText b "Bye" ! bsize <- getButtonRequestSize b -- get the minimal size of the button moveResizeControl b (rectAt (Point 0 (sh lsize)) bsize) -- position under the label registerButtonClick b (bye w l b) -- register event handler ! showWindow w -- show it all where + -- called on the first click with the window, label, and button as arguments. bye w l b = do setLabelText l "Goodbye" ! registerButtonClick b (closeWindow w) -- overwrite the old event handler |