• 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: changes to NSView's frame in its window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changes to NSView's frame in its window


  • Subject: Re: changes to NSView's frame in its window
  • From: John Joyce <email@hidden>
  • Date: Wed, 23 Jun 2010 13:35:02 -0500

On Jun 23, 2010, at 1:28 PM, Kyle Sluder wrote:

> On Wed, Jun 23, 2010 at 10:33 AM, Alexander Cohen <email@hidden> wrote:
>> I have a view in an NSScrollView's document view that has a small child window attached to it, meaning the window follows that view wherever it goes. But when i scroll the scrollview, not much changes for that view. So i'm wondering if there is anyway to get changes to a views "global" frame. If i'm missing something obvious, please do tell.
>
> Scroll views (actually, clip views) work by moving their bounds
> coordinate system. When AppKit draws the view hierarchy, it applies a
> transform to the current graphics context that is based on the bounds
> coordinate system of the view being drawn; this is how you can draw at
> (0,0) in your -drawRect: and have it appear at the right point in the
> superview. Likewise, as AppKit finishes drawing a view, it pops these
> transforms off the stack.
>
> By the time your overlay window draws, it's in another window
> entirely, so it has an entirely different transform stack—notably one
> lacking the transform the clip view has applied prior to your document
> view being drawn.
>
> Your child window or the content view thereof is going to need to
> listen for bounds-change notifications from the clip view and set its
> own bounds coordinate system to match.
> _______________________________________________

Depending on your needs, you may also want to consider subclassing NSViewController or NSWindowController to handle things.

_______________________________________________

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: 
 >changes to NSView's frame in its window (From: Alexander Cohen <email@hidden>)
 >Re: changes to NSView's frame in its window (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: changes to NSView's frame in its window
  • Next by Date: -enclosingScrollView returns nil when receiver is a descendant of the clip view
  • Previous by thread: Re: changes to NSView's frame in its window
  • Next by thread: Re: changes to NSView's frame in its window
  • Index(es):
    • Date
    • Thread