Re: Dumb question: How does NSScrollView know the size of the thing it's scrolling?
Re: Dumb question: How does NSScrollView know the size of the thing it's scrolling?
- Subject: Re: Dumb question: How does NSScrollView know the size of the thing it's scrolling?
- From: Quincey Morris <email@hidden>
- Date: Wed, 23 Jul 2008 11:28:26 -0700
On Jul 23, 2008, at 10:43, Rick Mann wrote:
What attribute of the contained views does NSScrollView (or the
NSScroller, whatever) use to determine what the scroll bars look
like? I read the doc a couple times, but I couldn't quite figure it
out. Is it the bounds.size of my contained view? What if I'm setting
a CoreGraphics CTM to zoom in on my drawing (my drawing code is all
done using the CoreGraphics API)...I would want the extent of the
scrollable area to grow accordingly...what attribute do I change?
The scroll bars depend on the ratio of the clip view bounds size (i.e.
self.enclosingScrollView.contentView.bounds.size) to your view's frame
(i.e. self.frame.size). So, if you zoom in to 200%, you should double
your view's frame size to get the scrollbars to do the right thing.
Depending on how you go about drawing the view's scaled contents, you
may or may not want to change the view bounds.
_______________________________________________
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