<div dir="ltr"><div>Hello fellow Racketeers. I apologize in advance for asking an extremely dumb question:<br><br>I am currently learning about the Graphical Interface Toolkit. I'm trying to do something that should be very simple: have a pasteboard with a single image-snip, and have the mouse cursor change to a hand when it is over the image-snip. Based on what I've read, it seems like I need to create a new subclass of image-snip%, and override adjust-cursor so that it changes the mouse cursor into a hand. Here's my code:<br>
<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 pb (new pasteboard%))<br>(send c set-editor pb)<br><br>(define hand-cursor-snip%<br>  (class image-snip%<br>    (define/override (adjust-cursor dc x y editorx editory event)<br>      (make-object cursor% 'hand))<br>
    (super-make-object)))<br><br>(define ufo (make-object hand-cursor-snip% "ufo.jpg" 'jpeg))<br>(send pb insert ufo)<br><br>(send f show #t)<br><br>My ufo picture does appear on the pasteboard, and it can be dragged and resized as usual. But the mouse cursor doesn't change when it is over the ufo.<br>
<br>I'm sure this is a facepalm-worthy mistake; I'm a newb at this. What should I do instead? Thanks in advance.<br><br></div>-Joseph DiMuro<br></div>