[plt-scheme] mouse event

From: Robby Findler (robby at cs.uchicago.edu)
Date: Tue May 6 14:38:16 EDT 2003

(define my-canvas%
  (class canvas%
    (define/override (on-event evt)
      (when (send evt button-down?)
        (printf "click at (~a, ~a)\n" 
                (send evt get-x)
                (send evt get-y))))
    (super-instantiate ())))

(define f (instantiate frame% ()
            (label "frame")
            (width 100)
            (height 100)))
(define c (instantiate my-canvas% ()
            (parent f)))

(send f show #t)

At Mon, 5 May 2003 23:20:50 +0200, "Ziighou" wrote:
> ------------------------------------------------------------------------------
> Can you give me some examples of mouse event in a canvas (return pos x
> and y when you click the canvas).
> Thank you.
> 
> ------------------------------------------------------------------------------
> 
> Can you give me some examples of mouse event in a canvas (return pos x and y when you click the canvas).
> 
> Thank you.
> 



Posted on the users mailing list.