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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to