Update of /cvsroot/htoolkit/port/src/examples
In directory sc8-pr-cvs1:/tmp/cvs-serv28423/src/examples
Modified Files:
ByeDemo.hs
Log Message:
Update the example after last changes in Port library
Index: ByeDemo.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/examples/ByeDemo.hs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ByeDemo.hs 31 Jan 2003 23:27:24 -0000 1.2
--- ByeDemo.hs 8 Feb 2003 08:39:35 -0000 1.3
***************
*** 17,25 ****
demo
= do w <- createWindow
- registerWindow w -- register for proper shutdown
registerWindowDismiss w (closeWindow w) -- close when the user dismisses the window
! 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
--- 17,23 ----
demo
= do w <- createWindow
registerWindowDismiss w (closeWindow w) -- close when the user dismisses the window
! setWindowDomainSize w (sz 0 0) -- no scroll bars needed
! setWindowViewSize w (sz 80 40) -- guess some size as Port has no layout manager
setWindowTitle w "Bye!" -- set the title bar text
***************
*** 27,36 ****
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
--- 25,34 ----
setLabelText l "Hello World!"
lsize <- getLabelRequestSize l -- get the minimal size of the label
! moveResizeControl l (rectAt (pt 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 (pt 0 (sh lsize)) bsize) -- position under the label
registerButtonClick b (bye w l b) -- register event handler
|