Re: Finder window - coordinates and screen?
Re: Finder window - coordinates and screen?
- Subject: Re: Finder window - coordinates and screen?
- From: Uli Kusterer <email@hidden>
- Date: Mon, 25 Jun 2007 23:50:40 +0200
On 25.06.2007, at 19:19, Finlay Dobbie wrote:
I can't say I know offhand. You'll probably get a string back from
AppleScript, you'll probably want to parse that into a few floating
point numbers, then do the usual jiggery pokery to translate the
coordinate bases.
The origin is on NSScreen #0, i.e. the first screen on the screens
array, which is the one that holds the menu bar. AppleScript uses
flipped coordinates, which have 0,0 at the upper left, with the Y
axis going down. To convert the coordinates, you'll have to calculate
the enclosing rectangle of all screens.
After that, you just do a little add/subtract dance with the Y
coordinate of whatever you want to convert. First subtract the height
of screen #0 from the Y coordinate, and then subtract it from the
height of the rect containing all screens, or something like that. I
usually draw myself a little picture, and then it becomes obvious
again...
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
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