home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff377.lzh
/
PowerLOGO
/
Examples
/
Mouse-Paint
< prev
next >
Wrap
Text File
|
1990-10-10
|
830b
|
21 lines
; 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.
]
] [ ]
]