Re: Mouse cursors and overlapping sibling NSViews
Re: Mouse cursors and overlapping sibling NSViews
- Subject: Re: Mouse cursors and overlapping sibling NSViews
- From: Sean McBride <email@hidden>
- Date: Thu, 24 Apr 2014 11:20:11 -0400
- Organization: Rogue Research Inc.
On Wed, 23 Apr 2014 20:16:22 -0500, Ken Thomases said:
>As far as I understood the original issue, it's that the
>cursor is set via tracking areas and -cursorUpdate: on one view but -
>mouseMoved: is being called on a different view. Sean wants Cocoa to be
>consistent about which view is asked to update the cursor and which is
>told that the mouse has moved.
>
>But I may have misunderstood.
>
>(Of course, the better solution, is seems to me, is to stop using
>sibling views in a situation that calls for subviews.)
That possibility is alas not available because my main custom view is 'layer hosting' and such views are not allowed to have subviews.
I think a screenshot and names would help:
<https://www.rogue-research.com/CocoaHierarchy.png>
My *actual* view hierarchy:
- BSStageHolderView (layer backed)
- BSStageView (layer hosting)
- NSButton
- NSPopUpButton
But for visual, mouse click, and mouse cursor purposes, I wish my hierarchy was:
- BSStageHolderView (layer backed)
- BSStageView (layer hosting)
- NSButton
- NSPopUpButton
By having BSStageHolderView's subviews array ordered as they are above, the subviews are visually correct and the mouse hits are correct, but I'm having trouble with the mouse cursors.
Tracking areas are nice, but limited to rects, and I have circular areas to deal with too. Other than using hundreds of them to approximate a circle it seems I must use mouseMoved: for cursors. Also my cursors need to change based on modifier keys.
It's mostly working fine, except when I hover the mouse over the NSButtons, then BSStageView's mouseMoved: get called.
First, I wanted to understand if that's even expected behaviour, but have found no answer in docs. I guess it is an edge case.
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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