• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Knowing if a scroll view is being scrolled
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Knowing if a scroll view is being scrolled
      • From: "I. Savant" <email@hidden>
References: 
 >Re: Knowing if a scroll view is being scrolled (From: James Bucanek <email@hidden>)
 >Re: Knowing if a scroll view is being scrolled (From: Half Activist <email@hidden>)

  • Prev by Date: Re: Detecting Failed TableView Drag?
  • Next by Date: Re: Newbie Q: Is it possible to draw functional "Cocoa Controls" in an OpenGL context?
  • Previous by thread: Re: Knowing if a scroll view is being scrolled
  • Next by thread: Re: Knowing if a scroll view is being scrolled
  • Index(es):
    • Date
    • Thread