Re: What's the replacement for GetMBarHeight?
Re: What's the replacement for GetMBarHeight?
- Subject: Re: What's the replacement for GetMBarHeight?
- From: Mike Wright <email@hidden>
- Date: Sat, 9 Feb 2008 15:18:08 -0500
On 9 Feb 2008 07:38:53 -0800 Steve Christensen <email@hidden> wrote:
On Feb 8, 2008, at 7:05 PM, Brian Arnold wrote:
The Xcode 3 OSX 10.5 documentation for GetMBarHeight fails to
explain what should be called in its place, or that it's not
available 64-bit. I need to avoid putting windows where they
shouldn't be, and my code is being called from code that isn't pure
Cocoa, but I can call Cocoa from where I can figure this out. What
do I call?
Please point me in the right direction, thanks,
How about something like [[NSScreen mainScreen] visibleFrame]?
To paraphrase the docs: -[visibleFrame] returns a rectangle
containing current location and dimensions of the visible screen.
This is the rectangle defining the portion of the screen in which it
is currently safe to draw your application content based on the
current user-interface settings and does not include the area
currently occupied by the dock and menu bar. Because it is based on
the current user -interface settings, the returned rectangle can
change between calls and should not be cached.
To be 100% correct, you could iterate over all the screens, for those
folks with more than one screen.
steve
And, On 9 Feb 2008 11:03:02 -0500 Brian Arnold <email@hidden
> wrote:
Calling [[NSApp mainMenu] menuBarHeight] did the trick. Thanks!
On Feb 9, 2008, at 12:27 AM, Jonathon Mah wrote:
Hi Brian,
On 2008-02-09, at 13:35, Brian Arnold wrote:
The Xcode 3 OSX 10.5 documentation for GetMBarHeight fails to
explain what should be called in its place
Probably -[NSMenu menuBarHeight].
Jonathon Mah
email@hidden
Just my two cents, but if you're positioning a window, you shouldn't
only be concerned with the top of the window. In that case, Steve's
solution is the right one.
I keep my Dock along the left edge of my screen, and it bugs me when
an application puts the left edge of its new or zoomed windows behind
it.
Cheers,
Mike Wright
http://www.idata3.com/
http://www.raccoonbend.com/
_______________________________________________
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