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

Re: Keeping NSView square


  • Subject: Re: Keeping NSView square
  • From: Kyle Sluder <email@hidden>
  • Date: Thu, 19 Nov 2009 00:10:24 -0800

2009/11/18 Andrew Farmer <email@hidden>:
> Don't. Arbitrarily changing the size of your view in setFrame: makes AppKit lose track of what size your view was, making it impossible to restore the original size later. Cut the view down to square at draw time instead.

This sounds like an even worse idea.

If your concern is about autoresizing, override
-resizeWithOldSuperviewSize:.  Otherwise, never call -setFrame: with a
non-square size.  (Perhaps you can override -setFrame: to throw an
exception if it's given a non-square frame.)

--Kyle Sluder
_______________________________________________

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: Keeping NSView square
      • From: Andrew Farmer <email@hidden>
References: 
 >Keeping NSView square (From: Henri Häkkinen <email@hidden>)
 >Re: Keeping NSView square (From: Andrew Farmer <email@hidden>)

  • Prev by Date: Re: Keeping NSView square
  • Next by Date: Re: Keeping NSView square
  • Previous by thread: Re: Keeping NSView square
  • Next by thread: Re: Keeping NSView square
  • Index(es):
    • Date
    • Thread