Re: Variable window size based on screen resolution
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