• 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: resizing window containing NSView with CALayer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resizing window containing NSView with CALayer


  • Subject: Re: resizing window containing NSView with CALayer
  • From: Ken Ferry <email@hidden>
  • Date: Mon, 08 Aug 2011 16:37:30 -0700

On Mon, Aug 8, 2011 at 5:23 AM, Graham Cox <email@hidden> wrote:

>
> On 08/08/2011, at 9:35 PM, julius wrote:
>
> > When I go and drag the resize handle to make the window as small as I can
> make it, i.e. so the window's content rect has zero height then the view
> misbehaves, i.e. the top of the view shifts from being some 100 pixels below
> the title bar to being 0 pixels below it!
>
>
> Ummm, well, that's not what you said was going on originally. This is
> normal.
>
> The reason this happens is that once either the width or height goes to 0,
> there's nothing for the view sizing code to mutliply by to end up with the
> destination size - once you hit a zero, the sizing information is lost. To
> prevent this, set a minimum size on the window. This is a good idea in any
> case - there is no possible use for a zero-sized window.


See also Cocoa Auto Layout, which addresses this issue among others.  (Have
people caught this? I'm a little surprised there hasn't been more chatter.
 We're replacing the autoresizing mask entirely.)

Programming guide<http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AutolayoutPG/Articles/Introduction.html>,
release notes<http://developer.apple.com/library/mac/#releasenotes/UserExperience/RNAutomaticLayout/_index.html>,
IB docs<http://developer.apple.com/library/mac/#recipes/xcode_help-interface_builder/_index.html>,
sample code<http://developer.apple.com/library/mac/#samplecode/Cocoa_Autolayout_Demos/Introduction/Intro.html>,
WWDC video<https://developer.apple.com/itunes/?destination=adc.apple.com.8270634034.08270634040.8367260891?i=2124831445>
.

-Ken
Cocoa Frameworks
_______________________________________________

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: resizing window containing NSView with CALayer
      • From: Kyle Sluder <email@hidden>
References: 
 >resizing window containing NSView with CALayer (From: julius <email@hidden>)
 >Re: resizing window containing NSView with CALayer (From: Graham Cox <email@hidden>)
 >Re: resizing window containing NSView with CALayer (From: julius <email@hidden>)
 >Re: resizing window containing NSView with CALayer (From: Graham Cox <email@hidden>)
 >Re: resizing window containing NSView with CALayer (From: julius <email@hidden>)
 >Re: resizing window containing NSView with CALayer (From: Graham Cox <email@hidden>)
 >Re: resizing window containing NSView with CALayer (From: julius <email@hidden>)
 >Re: resizing window containing NSView with CALayer (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Drawing text like Lion's Mail
  • Next by Date: Re: resizing window containing NSView with CALayer
  • Previous by thread: Re: resizing window containing NSView with CALayer
  • Next by thread: Re: resizing window containing NSView with CALayer
  • Index(es):
    • Date
    • Thread