• 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: Zooming a view, that is contained in an NSScrollView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Zooming a view, that is contained in an NSScrollView


  • Subject: Re: Zooming a view, that is contained in an NSScrollView
  • From: John Pannell <email@hidden>
  • Date: Mon, 17 Oct 2011 12:59:06 -0600

Hi Nick-

There is some composition of views needed to make this work.  Within GCDrawKit, find the GCZoomView class… make your custom view a subview of this (to adopt all of its zoomy goodness).  Then, make your custom drawing view the documentView of an NSScrollView.

You'll now need to wire up some controls in the UI (i.e. some menu items or buttons) to call the various zooming methods that your view has now inherited from GCZoomView.  Once you're wired up correctly, everything will "just work" - the scroll view will respond to the size changes of your document, and your drawing will now scale up and down per the user's use of the controls you've provided.

It is a really nice bit of code (thanks Graham!)

John


John Pannell
http://www.positivespinmedia.com

On Oct 17, 2011, at 12:46 PM, Nick wrote:

> Hi Fritz,
> thank you for the link.
> My application actually is very simple, and the drawing part is
> implemented already "by hand".
> So I was just wondering whether or not (and how) it is possible to
> implement this zooming using NSScrollView
>
> 2011/10/17 Fritz Anderson <email@hidden>:
>> On 17 Oct 2011, at 11:47 AM, Nick wrote:
>>
>>> I am trying to implement a simple vector graphics editor.
>>> I have some thoughts on how to implement the elements positioning,
>>> storage and select-ability.
>>
>> GCDrawKit <http://apptree.net/drawkit.htm> may help you make (a lot of) progress.
>>
>>        — F
>>
>>
> _______________________________________________
>
> 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

_______________________________________________

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

  • Follow-Ups:
    • Re: Zooming a view, that is contained in an NSScrollView
      • From: Graham Cox <email@hidden>
References: 
 >Zooming a view, that is contained in an NSScrollView (From: Nick <email@hidden>)
 >Re: Zooming a view, that is contained in an NSScrollView (From: Fritz Anderson <email@hidden>)
 >Re: Zooming a view, that is contained in an NSScrollView (From: Nick <email@hidden>)

  • Prev by Date: Re: Zooming a view, that is contained in an NSScrollView
  • Next by Date: NSScrollView Anomaly
  • Previous by thread: Re: Zooming a view, that is contained in an NSScrollView
  • Next by thread: Re: Zooming a view, that is contained in an NSScrollView
  • Index(es):
    • Date
    • Thread