Re: NSScrollView
Re: NSScrollView
- Subject: Re: NSScrollView
- From: Jonathon Mah <email@hidden>
- Date: Wed, 20 Apr 2005 03:37:39 +0930
Hi Brian,
On 20 Apr 2005, at 03:01, Brian O'Brien wrote:
Hi.. bit of a newbie question here...
I have been developing an image viewer and it is a subclass of an
NSView
I want to have many images on the viewer and be able to scroll
horizontally or vertically if necessary.
I was thinking the NSScrollView may be ideal for this.. would you
agree?
Yes, you'd definitely want to use an NSScrollView. From your wording,
though, it sounds like you may not fully understand what an
NSScrollView does (forgive me if I'm wrong, though).
A quick explanation: A scroll view is like a wrapper around another
view. Say you have some kind of view that represents a page (700x1000
pixels, say), and you can put text blocks wherever you want. On its own
it'd need a really big window to display it. So you ask Interface
Builder to make it a subview of NSScrollView, and now you can use a
smaller window. The scroll view will take care of deciding which part
of the larger view to display, and scrolling it. From the page view's
perspective, though, it knows nothing about the NSScrollView - drawing
something at 350x500 will appear in the middle of the page, not the
middle of the scroll view.
So you'd make some big view to display the images (well, the view could
start out small and grow as things are added), and just drop it into an
NSScrollView.
Hope this helps,
Jonathon Mah
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >NSScrollView (From: "Brian O'Brien" <email@hidden>) |