Re: Change NSCursor globally
Re: Change NSCursor globally
- Subject: Re: Change NSCursor globally
- From: Uli Kusterer <email@hidden>
- Date: Tue, 21 Feb 2017 02:12:21 +0100
On 15 Feb 2017, at 11:24, Colas B <email@hidden> wrote:
> thanks for your answer.
> I want to do the former: when the user enables a mode in the application, the cursor changes, exactly in the way you described (the shape changes). The user should be able to use this custom cursor over a PDFView, a UIScrollView, etc. However, I need the cursor only in one window. Later the user can leave this mode and go back to the normal behaviour.
> I'm looking for a solution that does not require subclassing all the views.
This is still very vague, so I don't think I have enough information to help you.
The problem might be that you have overlapping tracking regions, where one is fully contained inside the other. I think NSTrackingArea doesn't like that (it's been a while, so I might be mis-remembering).
I'm not sure if there's a way to remove or move the other tracking areas, but that seems like a skanky hack. You can't handle this in a generic way without risking unexpected behaviour from the views involved.
That said, depending on what views you're dealing with, you might have luck with overriding its parent view's hitTest method.
-- Uli
PS - I'm a bit confused about your code, as it contains mentions of iPhone and you mention UIScrollView ... but iOS doesn't have a mouse ... ? Typos?
_______________________________________________
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