Re: Cursor zone
Re: Cursor zone
- Subject: Re: Cursor zone
- From: email@hidden
- Date: Sat, 16 Feb 2002 11:00:45 -0800
[A side note: if people asking questions are going to cross-post between
cocoa-dev and macosx-dev, I think they should do it with an explicit
cross-post by addressing a single message to both lists. Separate posts
to each list means that the person answering the question has to then
post a reply separately to each list, which is annoying, and means that
followup discussion is split on the two lists. That said, I personally
think it would be nice if question posters just chose one list or the
other; I suspect the reader list for the two is close to identical, so
cross-posting just wastes everybody's time. I wonder whether we, the
cocoa developer community, should be making noise about combining these
lists, in fact; do they serve any distinct function apart? Anyhow, on
to the thread at hand...]
I am trying to set a sensitive zone to change the image of my cursor. I
can do it easily if I use a NSRect and [self addCursorRect:myRect
cursor:myCursor];
But is it possible to make a cursor zone a different shape ?
For instance, I have a circle in my view and when the arrow cursor
moves over this circle, I would like it to change to another cursor
image. What is the best solution for that ?
I believe there is API to do this in CoreGraphics, from what I recall,
but it does not appear to be public. So you're out of luck. Log a bug
on Apple (so maybe they'll make this API public in the future), and then
you have a few choices:
o Add multiple tracking rects that more or less "scan convert" your
circle into a set of rectangular areas.
o Use a single rect and live with it.
o Try to use [NSCursor pushCursor] / [NSCursor popCursor], and struggle
with the various issues raised earlier on the list about the problems
with this approach and its basic lack of support in the Kit.
Of the three, I'd recommend choice #1; you may not need to use very
many rectangles to give the user the feel that the circle is the "live"
area, depending on how big the circle is. I'd just write a utility
method (perhaps a category, to harken to other current threads ;->) that
does this for you in a general way.
Ben Haller
Stick Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.