[racket] Can I capture the mouse events of canvas% without sub-classing?
Am I right in thinking that while you can add a callback to respond
the on-paint event of canvas% at construction time, i.e..
(new canvas% ...
[paint-callback (lambda (c e) ...)])
to respond to other events -- mouse, keyboard, etc. -- it is necessary to
sub-class?
E.g.
(define my-canvas%
(class canvas%
(define/override (on-event ev)
(when (send ev button-down? 'left)
; do something
(super-new)))
Or are there alternatives?
Thanks
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131130/714042e5/attachment.html>