• 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: NSWindow - how to resize it keeping aspect ratio?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindow - how to resize it keeping aspect ratio?


  • Subject: Re: NSWindow - how to resize it keeping aspect ratio?
  • From: "Alexander Bokovikov" <email@hidden>
  • Date: Thu, 25 Feb 2010 20:37:17 +0500

On Thursday, February 25, 2010 at 5:57 PM Ariel Feinerman wrote:

You calculate view`s aspect from it size, but I mean content frame (not
window frame) from constant aspect, for example 4/3, then set size.

I don't understand what is the problem. Isn't "my" 422/674 ratio not a constant? What is a principal difference between it and "yours" 4/3? Just substitute my digits to whatever you need. You'll get just the same result.


This constant, used in the message, will keep the aspect ratio. Now you can (if you wish to) set an initial width of the window (e.g. in the awakeFromNib), and window height will be adjusted respectively. You don't need to store both width and height in the preferences. Just save width. Height will be adjusted automatically. At least it works for me.

Thanks.

_______________________________________________

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: NSWindow - how to resize it keeping aspect ratio?
      • From: Oftenwrong Soong <email@hidden>
References: 
 >NSWindow - how to resize it keeping aspect ratio? (From: "Alexander Bokovikov" <email@hidden>)
 >Re: NSWindow - how to resize it keeping aspect ratio? (From: Eric Gorr <email@hidden>)
 >Re: NSWindow - how to resize it keeping aspect ratio? (From: Ariel Feinerman <email@hidden>)
 >Re: NSWindow - how to resize it keeping aspect ratio? (From: Alexander Bokovikov <email@hidden>)
 >Re: NSWindow - how to resize it keeping aspect ratio? (From: Ariel Feinerman <email@hidden>)

  • Prev by Date: Re: NSWindow - how to resize it keeping aspect ratio?
  • Next by Date: Re: NSWindow - how to resize it keeping aspect ratio?
  • Previous by thread: Re: NSWindow - how to resize it keeping aspect ratio?
  • Next by thread: Re: NSWindow - how to resize it keeping aspect ratio?
  • Index(es):
    • Date
    • Thread