Re: Getting current mouse position after scroll
Re: Getting current mouse position after scroll
- Subject: Re: Getting current mouse position after scroll
- From: Kyle Sluder <email@hidden>
- Date: Wed, 1 Dec 2010 23:53:39 -0800
On Wed, Dec 1, 2010 at 8:15 PM, Rick Mann <email@hidden> wrote:
>
> On Dec 1, 2010, at 20:14:09, Kyle Sluder wrote:
>
>> On Wed, Dec 1, 2010 at 7:19 PM, Rick Mann <email@hidden> wrote:
>>> Cocoa.
>>>
>>> I have a view that shows the coordinates of the current mouse location in it. I update this via -mouseMoved: But if the user scrolls the view with a scroll ball, I don't get mouse moved events.
>>>
>>> 1) What's the best way to react to scroll changes? I'm currently observing the NSViewBoundsDidChangeNotification.
>>
>> On which view?
>
> My view inside the scrollview.
Listen for bounds change notifications on the clip view (aka the
scroll view's -contentView) instead. That's how scrolling actually
works: the clip view changes its bounds origin and the regular view
drawing machinery takes care of the rest by translating the document
view's origin into the clip view's bounds coordinate system.
--Kyle Sluder
_______________________________________________
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