Re: How to create a new window initially zoomed to the maximal size?

2008-09-20 Thread Benjamin Stiglitz
 What I want to achieve is that when a new window is created, it has
 the maximal size allowed by the screen, menu and the dock, exactly
 like if someone clicked the green zoom button in the window's title
 bar. I don't want any resizing animation or flickering though.

Before ordering the window onto the screen, you can set its frame to
fill the screen by calling -[NSWindow zoom:]. Alternatively, you can set
its frame to [[window screen] defaultFrame], which is the same frame
that -zoom: will use, subtracting space for any visible drawers.

-Ben
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How to create a new window initially zoomed to the maximal size?

2008-09-20 Thread j o a r


On Sep 20, 2008, at 11:02 AM, Oleg Krupnov wrote:


What I want to achieve is that when a new window is created, it has
the maximal size allowed by the screen, menu and the dock, exactly
like if someone clicked the green zoom button in the window's title
bar. I don't want any resizing animation or flickering though.



You would have to resize the window manually. To find out how to size  
and position it, ask NSScreen for the appropriate frame. To avoid  
flickering, do this in awakeFromNib or similar, before the window is  
put on screen.


j o a r


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How to create a new window initially zoomed to the maximal size?

2008-09-20 Thread j o a r


On Sep 20, 2008, at 11:11 AM, Benjamin Stiglitz wrote:

Alternatively, you can set its frame to [[window screen]  
defaultFrame], which is the same frame

that -zoom: will use, subtracting space for any visible drawers.



I think that should be:

-[NSScreen visibleFrame]

j o a r


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: How to create a new window initially zoomed to the maximal size?

2008-09-20 Thread Benjamin Stiglitz
On Sat, Sep 20, 2008 at 12:22:52PM -0700, j o a r wrote:
 Alternatively, you can set its frame to [[window screen]  
 defaultFrame], which is the same frame
 that -zoom: will use, subtracting space for any visible drawers.

 I think that should be:

   -[NSScreen visibleFrame]

Yes, that’s correct—my mistake.

-Ben
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]