home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.002 / stk-3 / STk-3.1 / Contrib / STk-wtour / lessons / canvas-funky.stk < prev    next >
Encoding:
Text File  |  1995-12-13  |  315 b   |  16 lines

  1. ;;; Drawing in a Canvas (funky version)
  2. ;;;   (draw with mousebutton 1)
  3.  
  4. (define wid 0)
  5.  
  6. (pack (canvas '.c1) :expand #t :fill "both")
  7.  
  8. (bind .c1 "<ButtonPress-1>" (lambda ()
  9.                   (set! wid 0)))
  10.  
  11. (bind .c1 "<B1-Motion>" (lambda (x y)
  12.               (.c1 'create 'rectangle x y x y :width wid)
  13.               (set! wid (1+ wid))))
  14.  
  15.  
  16.