Re: Centering a window on the *current* screen, not the *main* screen
Re: Centering a window on the *current* screen, not the *main* screen
- Subject: Re: Centering a window on the *current* screen, not the *main* screen
- From: Graham Cox <email@hidden>
- Date: Tue, 26 Jan 2010 21:34:00 +1100
On 26/01/2010, at 9:10 PM, Oleg Krupnov wrote:
> Now how do I center a window on the screen it currently shows on, on a
> multi-monitor Mac?
You need to consider what this really means. For example, what if a window is placed so appears on more than one monitor at the same time?
Actually, NSWindow already works this out - its -screen method returns the screen it mostly is placed on (i.e. contains the largest intersected area). That's handy.
> I could write my own code to position the window, but I don't know how
> to reproduce the recommended position of the centered window, which is
> slightly above the center.
Traditionally, this has been at a position leaving one third of the space above and two thirds below, though I'm not sure if that's still currently the exact placing.
--Graham
_______________________________________________
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