• 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: NSScrollView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSScrollView
      • From: "Brian O'Brien" <email@hidden>
References: 
 >NSScrollView (From: "Brian O'Brien" <email@hidden>)

  • Prev by Date: Accessing DOM in 10.3.9
  • Next by Date: Re: Saving UTF-8 as File
  • Previous by thread: NSScrollView
  • Next by thread: Re: NSScrollView
  • Index(es):
    • Date
    • Thread