• 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: David Blanton <email@hidden>
  • Date: Thu, 7 Jan 2010 21:58:53 -0700

If a scroll view's content view is larger than the scroll view then the scroll view generates scrollers - correct?

Let me try to get to some of the REALLY

1. I want to always make the content view some factor larger than the scroll view to keep the scroller knobs a uniform size.

2. If the user scrolls I want to tell my model how much was scrolled so it can regenerate a bitmap for display.

3. If the window size changes apply a factor to the content view to achieve 1 above.

 -db


On Jan 7, 2010, at 9:33 PM, Graham Cox wrote:


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: Graham Cox <email@hidden>
References: 
 >NSScroller (From: David Blanton <email@hidden>)
 >Re: NSScroller (From: Graham Cox <email@hidden>)
 >Re: NSScroller (From: David Blanton <email@hidden>)
 >Re: NSScroller (From: Graham Cox <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