Re: Weird scrolling thing in Lion
Re: Weird scrolling thing in Lion
- Subject: Re: Weird scrolling thing in Lion
- From: Graham Cox <email@hidden>
- Date: Wed, 04 Apr 2012 15:37:57 +1000
On 04/04/2012, at 11:49 AM, James Maxwell wrote:
> Ah, found it in DrawKit -- DKViewController, [view stopAutoScrolling].
> Thanks Graham! ;-)
>
> (weird that I didn't need this beforeā¦)
>
> J.
Autoscrolling is performed by a timer, so that it happens smoothly as long as the mouse is at the edges of the scroll view. When the mouse goes down, the timer starts,and when the mouse goes up, it stops.
If you have swallowed the mouse-up, you need to stop the timer yourself, or scrolling will continue when the mouse is outside of the view, even though you're not dragging. -stopAutoScrolling will do that.
One reason you may have swallowed the mouseUp is that you implemented your own event loop called from mouseDown. If you do this, you might need to be careful about cleaning up after yourself, because DK does not generally expect (or need) you to do that. However, it does do this itself when creating new path objects, so it's not unheard of. One way I deal with this is to post a fake mouseUp when I'm done, then the normal processing takes care of the standard clean-up.
--Graham
_______________________________________________
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