Creating & Using a Custom Cursor?

Barry Levine themacguy at macosx.com
Mon Jan 27 12:13:00 EST 2003


I need to set the cursor to a custom image and keep it persistent. How 
do I do this? Here is what I've tried so far:

I used iDraw to create a 16x16 image and saved it as a ".png" with 
"transparency". Then I created an image object within Rev, set it to 
16x16, and set the reference to the image I saved. Then I used the 
Image Library and, with the image object selected, I clicked the "Move 
selected image into this library. Finally I used the code:

   set the lockcursor to true
   set the cursor to id 1069 -- the id of my 16x16 image

Okay, this worked but the cursor is white. Not a solid white, but the 
black lines I created in iDraw (and which appear black in the image 
object) are white as the cursor. I do have a grey background graphic in 
the stack; would this be causing the cursor to appear white (against 
this grey background)?

The Rev docs are pretty vague on custom cursors. Speaking of which, I 
do see a "Custom Cursors" area in the Image Library. This is, I assume, 
the repository of custom cursors which is available to all Rev stacks?

So, in addition to my questions above, let's add these:

1. Can I add my custom cursor to my stack by another method? (Details, 
please.)

2. I don't want the image object containing the cursor picture 
appearing anywhere in my app (just the cursor itself when I call it). 
Can I delete the image object or do I need to keep it (but make the 
object invisible)? I suspect I need to keep it as the image ID is being 
referenced. I'd rather have it as an internal object (which probably 
moves us back to the previous question).

I have used ResEdit but never for cursor creation or management. 
Perhaps this is the method?

Thanks in advance for any assistance.

Regards,
Barry




More information about the use-livecode mailing list