home *** CD-ROM | disk | FTP | other *** search
-
- ; This example is a simple paint program. The first instruction opens a
- ; window, the second programs the mouse button demon to draw lines
- ; whenever the mouse button is pressed in this window.
- ; This runs entirely in the background, another program may be running
- ; at the same time
-
- make "m-window openwindow [ ]
- whenmouse [
- while [ mousep ] [ make "m-d getmouse ] ; Remove mouse event.
- if = :m-window first :m-d [ ; Correct window?
- move :m-window item 2 :m-d item 3 :m-d ; Move cursor.
- make "m-d mouse :m-window ; Check mouse.
- while [ = 1 item 3 :m-d ] [ ; While button is down
- draw :m-window first :m-d item 2 :m-d ; Draw to pointer.
- make "m-d mouse :m-window ; Check mouse.
- ]
- ] [ ]
- ]
-
-