• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Centering a window on the *current* screen, not the *main* screen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Centering a window on the *current* screen, not the *main* screen
      • From: "Glenn L. Austin" <email@hidden>
    • Re: Centering a window on the *current* screen, not the *main* screen
      • From: Andreas Mayer <email@hidden>
    • Re: Centering a window on the *current* screen, not the *main* screen
      • From: Oleg Krupnov <email@hidden>
References: 
 >Centering a window on the *current* screen, not the *main* screen (From: Oleg Krupnov <email@hidden>)

  • Prev by Date: Re: How to hide dock item and application menu?
  • Next by Date: BIG Thread problem (theorical).. need some advice.
  • Previous by thread: Centering a window on the *current* screen, not the *main* screen
  • Next by thread: Re: Centering a window on the *current* screen, not the *main* screen
  • Index(es):
    • Date
    • Thread