home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / powerlogo_377.lzh / PowerLOGO / Examples / Mouse-Paint < prev    next >
Text File  |  1990-10-10  |  830b  |  21 lines

  1.  
  2. ;     This example is a simple paint program. The first instruction opens a
  3. ;  window, the second programs the mouse button demon to draw lines
  4. ;  whenever the mouse button is pressed in this window.
  5. ;     This runs entirely in the background, another program may be running
  6. ;  at the same time 
  7.  
  8. make "m-window openwindow [ ]
  9. whenmouse [
  10.    while [ mousep ] [ make "m-d getmouse ]      ;  Remove mouse event.
  11.    if = :m-window first :m-d [                  ;  Correct window?
  12.       move :m-window item 2 :m-d item 3 :m-d    ;  Move cursor.
  13.       make "m-d mouse :m-window                 ;  Check mouse.
  14.       while [ = 1 item 3 :m-d ] [               ;  While button is down
  15.          draw :m-window first :m-d item 2 :m-d  ;  Draw to pointer.
  16.          make "m-d mouse :m-window              ;  Check mouse.
  17.       ]
  18.    ] [ ]
  19. ]
  20.  
  21.