On Aug 11, 2014, at 1:38 PM, Daryle Walker <dary...@mac.com> wrote:

> I’m thinking of implementing the (optimized) zoom green button.  I need to 
> provide a windowWillUseStandardFrame:defaultFrame: method to do that.  I’ve 
> read that the trial frame space given takes out room for the menu bar and the 
> dock.  Does it also remove space for the window’s chrome?

No.  A window has a "frame" which is its outside size, and a "content rect" 
which is the size of the content view, which excludes the title bar and, if the 
window has one, the (standard) toolbar.  You can convert between them using 
-[NSWindow frameRectForContentRect:] and -[NSWindow contentRectForFrameRect:].  
(There are also class methods that do something similar, but they can't take a 
toolbar into account.)

The -windowWillUseStandardFrame:defaultFrame: method operates in terms of the 
frame, not the content rect.

None of these methods will take into account the content border size.  That's 
considered to be inside the content rect.


> How can the optimized space for a WebView be determined?  (In other words, 
> given an infinite screen size, how much space would a WebView need to show 
> the entirety of its current page?)  I read that you need some difficult 
> internal calculation with JavaScript; I hope not.

I don't know.  It seems that most modern browsers don't make any particular 
effort to pick a zoom size that's optimized for the currently-displayed page.

Regards,
Ken


_______________________________________________

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

This email sent to arch...@mail-archive.com

Reply via email to