Re: Knowing if a scroll view is being scrolled
Re: Knowing if a scroll view is being scrolled
- Subject: Re: Knowing if a scroll view is being scrolled
- From: Alastair Houghton <email@hidden>
- Date: Thu, 15 Feb 2007 15:53:37 +0000
On 15 Feb 2007, at 15:30, Half Activist wrote:
Yeah, this is exactly what I was thinking about, but I wanted to
know if there wasn't a 'cleaner' way to do this.
What you could do is the following:
1. Subclass NSScroller, overriding -trackKnob: and -
trackScrollButtons: so that they generate a notification before and
after calling the superclass' implementation.
2. Subclass NSScrollView (assuming you're using it), then in -
initWithFrame: and/or -awakeFromNib:, check to make sure that the
scrollers are instances of your subclass and if not, replace them
(NSScrollView has methods to set the scrollers it's using). Then
have your subclass register for the notification generated by the
change in (1).
3. Finally, make your custom NSScrollView instance send messages to
the document view whenever it is scrolling. You'll want to do that
in response to the notifications from the NSScroller, and maybe in a
few other cases also.
It sounds a little complicated, but it isn't, and it's quite a clean
way to do it.
FWIW, I think it would be worth Apple making this kind of thing work
for split views as well as scroll views, as you can get the same
performance issues there too.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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