Re: Scroll view within scroll view blocks scrolling
Re: Scroll view within scroll view blocks scrolling
- Subject: Re: Scroll view within scroll view blocks scrolling
- From: Indragie Karunaratne <email@hidden>
- Date: Thu, 28 Apr 2011 21:27:40 -0600
Notice that in my code I'm making a call to super, so using the above code, scrolling inside the text view would scroll both the parent scroll view and the text view scroll view at the same time. In my case, 2) was the only important thing for me because my text views don't scroll vertically (only horizontally). You could make it behave like Safari by using an NSTimer to create the "cooling off" period, but this simple workaround was good enough for my needs :)
On 2011-04-28, at 9:05 PM, Conrad Shultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 4/28/11 7:42 PM, Indragie Karunaratne wrote:
>> Figured out a super easy solution for this. Override scrollWheel: in
>> an NSScrollView subclass:
>>
>> - (void)scrollWheel:(NSEvent *)theEvent { [super
>> scrollWheel:theEvent]; [[self nextResponder] scrollWheel:theEvent];
>> }
>>
>> Works great :-)
>
> Will this give the best behavior? Without testing, I assume that this
> always hands scrolling off to the superview (in your case).
>
> However, when I view a page in, say, Safari that has a scrollable
> textarea, I observe that:
>
> 1) If I start scrolling with my cursor in the textarea it scrolls the
> textarea.
>
> 2) If I start scrolling outside the textarea and scroll through it, the
> page continues to scroll instead of triggering scroll of the textarea.
>
> 3) If I pause scrolling with my cursor in the textarea, there is a
> couple second period during which resuming scrolling will still scroll
> the page. After this "cooling off" period, scrolling is handled as in
> case #1.
>
> While such behavior might not be what you envision, it does seem to be
> uniform across multiple browsers and therefore might be what a user
> expects (if you choose to go this route).
>
> - --
> Conrad Shultz
>
> Synthetiq Solutions
> www.synthetiqsolutions.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iD8DBQFNuirnaOlrz5+0JdURAu3OAJ0datgca59zgNUGiC+lbkM/bcPMOQCfWPvN
> nCbhxZ3QkTRyx5+z5SrXWcM=
> =RkVE
> -----END PGP SIGNATURE-----
_______________________________________________
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