• 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: Variable window size based on screen resolution
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Variable window size based on screen resolution


  • Subject: Re: Variable window size based on screen resolution
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 14 Nov 2011 10:06:14 -0800

On Nov 14, 2011, at 7:18 AM, Richard Somers wrote:

> One way would be to subclass NSWindow and override the designated initializer -initWithContentRect:styleMask:backing:defer: method. In the initializer you could query the screen resolution and set the window frame accordingly.

That seems like overkill. Just set the window’s frame appropriately in your controller code after the nib loads but before displaying the window, i.e. in a -windowDidLoad: or -awakeFromNib method. (Make sure the window is not set to be initially visible; there’s a checkbox for that in IB.) You can use the NSScreen class to get the size of the main screen.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: 
 >Variable window size based on screen resolution (From: Koen van der Drift <email@hidden>)
 >Re: Variable window size based on screen resolution (From: Richard Somers <email@hidden>)

  • Prev by Date: Re: Calling a Cocoa library from C
  • Next by Date: Re: Implementing Full Screen for 10.7 but app should also run on 10.6
  • Previous by thread: Re: Variable window size based on screen resolution
  • Next by thread: Implementing Full Screen for 10.7 but app should also run on 10.6
  • Index(es):
    • Date
    • Thread