Skip navigation.
 
mlRe: Sizing window question
FROM : Jonathan Hess
DATE : Sun Jan 20 19:23:19 2008

Hey John -

I think you're looking for -[NSWindow frameRectForContentRect:].

Good Luck -
Jon Hess

On Jan 20, 2008, at 8:47 AM, John Newlin wrote:

> I'm just learning the cocoa api's and have a couple of newbie 
> questions that I did not readily find in the docs:
>
>
> Question 1:
>  - I have a window, with a custom view.  I get the window from a nib 
> and can draw into the view, all good so far.  The question is this, 
> it's not until runtime that I know the size of the content.  I 
> figured out that I can resize the window with [aWindow frame], but 
> I'm not sure how to properly calculate the window size, so that the 
> view fits my content.
>
> i.e. Let's say I get the window, open my data file and I see I need 
> a view area of 120x120.  The custom view needs to be 120x120.  How 
> do you figure out the appropriate window size?
>
>
> Question 2:
> - When I'm resizing the window, how do you figure out the desktop 
> size, so that you don't make a window that is too big and goes 
> offscreen.
>
> Thanks for your time,
>
> -john
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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/<email_removed>
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlSizing window question John Newlin Jan 20, 17:47
mlRe: Sizing window question Philip Bridson Jan 20, 19:21
mlRe: Sizing window question Jonathan Hess Jan 20, 19:23
mlRe: Sizing window question Ronny Reichmann Jan 23, 11:24