Re: debugging cursors
Re: debugging cursors
- Subject: Re: debugging cursors
- From: Quincey Morris <email@hidden>
- Date: Thu, 8 Oct 2009 16:30:43 -0700
On Oct 8, 2009, at 16:01, David M. Cotter wrote:
i set the cursor in response to the user pressing enter after
editing a text edit.
then 1/2 second later, the OS sets it back to an arrow.
either ther'es a way to trap that, or there isn't. how do i set a
breakpoint on that?
There isn't. You can't do what you want to do because the cursor is a
shared resource that you don't own. The "OS" isn't taking control of
your cursor away from you, it simply doesn't provide a mechanism for
you to unconditionally take its cursor away from it.
Cursor ownership is a complex function of pointer position, view real
estate ownership, and time. Oh, and possible interaction between Cocoa
and Carbon implementations. You can gain control of the cursor over
real estate you control via (for example) the NSTrackingArea
mechanism, but even then (in part for historical reasons) your control
isn't as absolute as you might like.
If your app is something like a cursor editor (so your wish to control
the cursor is some kind of "preview" function), then you've got an
uphill battle. You might be able to solve that by overriding parts of
the NSCursor class implementation with a category or by swizzling
methods via the Objective-C runtime. For example, you might perhaps
get the effect you want simply by providing a new implementation of
[NSCursor arrowCursor] without messing anything else up. Or not.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden