The graphmath library defines patterns for making graphical computations: point, rectangle, matrix, region, etc. Each of these patterns defines several operations.
Remember that in order to utilize this extension to Lidskjalv, the fragment graphmath must be included as follows:
ORIGIN '~beta/guienv/guienv'; INCLUDE '~beta/guienv/graphmath' --- program: descriptor --- guienv(# p1, p2: @point; ... do ... p1 -> p2.inset -> ...; ... #)
This example gives an example of how to use the containsPoint operation of a rectangle.
ORIGIN '~beta/guienv/guienv'; (* This demo gives an example of how to use the containsPoint * operation of a rectangle. *) --- program: descriptor --- guienv (# theWindow: @window (# hitZone: @rectangle; open:: (# do 'Graphmath Demo' -> title; (40,40) -> position; (300,300) -> size; ((0,0), (30,30)) -> hitZone #); eventHandler:: (# onAboutToClose:: (# do terminate #); onMouseDown:: (# do (if localPosition -> hitZone.containsPoint then 'Mouse down in Hit Zone.' -> screen.putline if) #) #) #) do theWindow.open #)
Lidskjalv: User Interface Framework - Reference Manual | © 1994-2002 Mjølner Informatics |
[Modified: Friday October 27th 2000 at 14:56]
|