• 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: NSScroller
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSScroller


  • Subject: Re: NSScroller
  • From: Graham Cox <email@hidden>
  • Date: Fri, 8 Jan 2010 15:33:56 +1100

On 08/01/2010, at 3:21 PM, David Blanton wrote:

> I wan to send to my model code that the user scrolled the view and I want to know by how much.
>
> So, I thought I would implement trackKnob but I don't know how ....


To get the scroll position of the scrolled view is much more useful than getting the scroller's current value. [[aView scrollView] documentVisibleRect] will return a rect whose origin will be the scroll position. <aView> is any view (if it's not within a scrollview, you'll just get an empty rect).

However, I'm still wondering what business the document has knowing this. Scrolled views should work automatically and there is no reason to track scroll position. When a view is asked to draw, its dirty rects indicate what parts need drawing - by drawing only those parts you will automatically be drawing efficiently as new parts of the view are scrolled on screen. That's about the only scenario I can think of where it might matter, and it's already taken care of.

So, what are you REALLY trying to do?

--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

  • Follow-Ups:
    • Re: NSScroller
      • From: David Blanton <email@hidden>
References: 
 >NSScroller (From: David Blanton <email@hidden>)
 >Re: NSScroller (From: Graham Cox <email@hidden>)
 >Re: NSScroller (From: David Blanton <email@hidden>)

  • Prev by Date: Re: NSScroller
  • Next by Date: Re: NSScroller
  • Previous by thread: Re: NSScroller
  • Next by thread: Re: NSScroller
  • Index(es):
    • Date
    • Thread