<div dir="ltr"><div><div><div>Robby, thanks for the help. I'm going with your first version; given what I want to do, I think I'd rather put the code in the pasteboard instead of the snip.<br><br></div>I've made one further adjustment to your code, and added (super on-event evt) to the define/override. That way, the pasteboard does what it normally does, in addition to changing the mouse cursor when it is over the snip. Without that line, the snip is no longer selectable/draggable/resizable. (Your second version, where the code is inside the snip, works fine as it is.)<br>
<br></div>Thanks again.<br><br></div>-Joseph<br><div><div><div><br>#lang racket/gui<br><br>(define f (new frame%<br> [label "Adjust Cursor Test"]<br> [width 250]<br> [height 250]))<br>
<br>(define c (new editor-canvas% [parent f]))<br><br>(define hand-cursor-pasteboard%<br> (class pasteboard%<br> (inherit find-snip set-cursor)<br> (define hand-snips '())<br> (define/public (add-hand-snip s) (set! hand-snips (cons s hand-snips)))<br>
(define/override (on-event evt)<br> (super on-event evt)<br> (define snp (find-snip (send evt get-x) (send evt get-y)))<br> (set-cursor (if (member snp hand-snips)<br> hand-cursor<br>
#f)))<br> (super-new)))<br>(define hand-cursor (make-object cursor% 'hand))<br><br>(define pb (new hand-cursor-pasteboard%))<br>(send c set-editor pb)<br><br>(define ufo (make-object image-snip% "ufo.jpg" 'jpeg))<br>
(send pb insert ufo 100 100)<br>(send pb add-hand-snip ufo)<br>(send f show #t)<br></div></div></div></div>