• 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: Dumb question: How does NSScrollView know the size of the thing it's scrolling?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Graham Cox <email@hidden>
  • Date: Thu, 24 Jul 2008 11:39:27 +1000

For zooming, check out NSView's -scaleUnitSquareToSize: which changes the scale factor of the view's transform. Together with -setFrame: (or -setFrameSize:) you can implement arbitrary zooming. If the view is enclosed by a scroller, it will adjust the scrollbars automatically, as well as any rulers that are shown.

You could also use this simple NSView subclass that gives you straightforward high-level action methods for zooming:

http://apptree.net/gczoomview.htm

Though since writing that as a subclass of NSView I have discovered you can do the same using a NSView category - it's not necessary to store the scale factor as a data member (as I do here) but just work it out on the fly from other NSView values.

hth,


Graham

On 24 Jul 2008, at 5:20 am, Rick Mann wrote:

Thanks to everyone for their informative answers. I gotta say, I think the docs are a bit lacking, but maybe I just had certain assumptions going in (that a subview's frame should be contained within a superview's bounds, etc.)

--
Rick

_______________________________________________

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: 
 >Re: Dumb question: How does NSScrollView know the size of the thing it's scrolling? (From: Erik Buck <email@hidden>)
 >Re: Dumb question: How does NSScrollView know the size of the thing it's scrolling? (From: Rick Mann <email@hidden>)

  • Prev by Date: Cleaning up my Data Model
  • Next by Date: A study of the Cocoa Indie Island
  • Previous by thread: Re: Dumb question: How does NSScrollView know the size of the thing it's scrolling?
  • Next by thread: Re: NSLog on releasebuild
  • Index(es):
    • Date
    • Thread