Re: NSScrollView
Re: NSScrollView
- Subject: Re: NSScrollView
- From: Steve Christensen <email@hidden>
- Date: Sat, 11 Jul 2009 15:31:54 -0700
The view hierarchy is: NSScrollView -> NSClipView ->
YourDocumentView. I believe all you need to do is set the frame of
your document view to be the size needed to represent your diagram
and then everything else should "just work," i.e., the scrollbars
should correctly reflect the relative sizes of the NSScrollView and
the document view. The document view's -drawRect: method would then
determine what parts of the diagram intersect the specified drawing
rectangle and draw just those parts for speed.
On Jul 11, 2009, at 3:04 PM, Christopher Henrich wrote:
I am working on an app which (among other things) draws a diagram
which is likely to be too large for the window in which it is to be
displayed. Obviously, this is a job for NSScrollView.
I have been perusing the documentation of NSScrollView, and I do
not see an explicit statement of how to tell my scroll view the
current size of its "document view." The Scroll View Programming
Guide, in Creating and Configuring a Scroll View, has an example in
which both the frame rectangle and the bounds rectangle are set to
the size of the document view.
Based on the section How Scroll Views Work, I surmise that the
scroll view uses the frame rectangle to determine the size of the
document view. Have I got this right?
_______________________________________________
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
References: | |
| >NSScrollView (From: Christopher Henrich <email@hidden>) |