Using [NSScreen screens] I'm able to get all of the screens attached to the computer and their sizes, however I'm trying to find out their positions relative to each other (like in Arrangement in the Display preferences). Is there a way to do this? I've looked online and through the class references on Apple's developer site and found nothing. Thank you.
+1
A:
Aha! I was browsing API and found out how to do it. If you get an NSScreen's -deviceDescription
, you can get its CGDirectDisplayID
. From there you can use the Quartz Display Services from ApplicationServices to get the CGDisplayBounds
, which shows the display size and position relative to all screens.
Peter Zich
2010-07-27 00:58:09