RE: Converting to Window Coordinates

2015-04-22 Thread Lee Ann Rucker
unces+lrucker=vmware@lists.apple.com] on behalf of Dave [d...@looktowindward.com] Sent: Wednesday, April 22, 2015 1:56 PM To: Cocoa Developers Subject: Re: Converting to Window Coordinates > On 22 Apr 2015, at 20:52, Lee Ann Rucker wrote: > >> Is hit testing the content view the

Re: Converting to Window Coordinates

2015-04-22 Thread Dave
> On 22 Apr 2015, at 20:52, Lee Ann Rucker wrote: > >> Is hit testing the content view the only way to tell which window a point >> falls within? At the moment I loop though all windows until I find one which >> works, but is a bit inefficient. > > Since everything's in the same coordinate sp

Re: Converting to Window Coordinates

2015-04-22 Thread Dave
> On 22 Apr 2015, at 20:52, Lee Ann Rucker wrote: > >> Is hit testing the content view the only way to tell which window a point >> falls within? At the moment I loop though all windows until I find one which >> works, but is a bit inefficient. > > Since everything's in the same coordinate sp

RE: Converting to Window Coordinates

2015-04-22 Thread Lee Ann Rucker
window frame. From: cocoa-dev-bounces+lrucker=vmware@lists.apple.com [cocoa-dev-bounces+lrucker=vmware@lists.apple.com] on behalf of Dave [d...@looktowindward.com] Sent: Wednesday, April 22, 2015 9:10 AM To: Cocoa Developers Subject: Re: Converting to Window Co

Re: Converting to Window Coordinates

2015-04-22 Thread Jens Alfke
> On Apr 22, 2015, at 9:46 AM, Scott Ribe wrote: > > On Apr 22, 2015, at 10:10 AM, Dave wrote: >> >> I really can’t understand why it was ever defined to be bottom left, does >> anyone know why? > > Normal Cartesian coordinates. (I agree the other way made sense, measuring > from the menu b

Re: Converting to Window Coordinates

2015-04-22 Thread Scott Ribe
On Apr 22, 2015, at 10:10 AM, Dave wrote: > > I really can’t understand why it was ever defined to be bottom left, does > anyone know why? Normal Cartesian coordinates. (I agree the other way made sense, measuring from the menu bar…) -- Scott Ribe scott_r...@elevated-dev.com http://www.eleva

Re: Converting to Window Coordinates

2015-04-22 Thread Dave
; [cocoa-dev-bounces+lrucker=vmware@lists.apple.com] on behalf of Dave > [d...@looktowindward.com] > Sent: Wednesday, April 22, 2015 3:55 AM > To: Cocoa Developers > Subject: Re: Converting to Window Coordinates > > Hi Again Lee Ann, > > Thanks a lot for this, one thing

RE: Converting to Window Coordinates

2015-04-22 Thread Lee Ann Rucker
ates aren't what you expect. From: cocoa-dev-bounces+lrucker=vmware@lists.apple.com [cocoa-dev-bounces+lrucker=vmware@lists.apple.com] on behalf of Dave [d...@looktowindward.com] Sent: Wednesday, April 22, 2015 3:55 AM To: Cocoa Developers Subject: Re: Converting to

Re: Converting to Window Coordinates

2015-04-22 Thread Dave
Hi Again Lee Ann, Thanks a lot for this, one thing though, how do I tell which window the position is in? At present I loop through all my open windows and apply run “hitTest” on the content view until I find one. > Another thing you've missed: converting to myContentView's coordinate space >

RE: Converting to Window Coordinates

2015-04-21 Thread Lee Ann Rucker
] on behalf of Dave [d...@looktowindward.com] Sent: Tuesday, April 21, 2015 2:04 PM To: Cocoa Developers Subject: Re: Converting to Window Coordinates Hi Again, Yes, I wondered about multiple monitors but it seems to work ok, I’ve got 3 monitors hooked up and it works regardless of where they are

Re: Converting to Window Coordinates

2015-04-21 Thread Dave
Dave > [d...@looktowindward.com] > Sent: Tuesday, April 21, 2015 9:46 AM > To: Cocoa Developers > Subject: Re: Converting to Window Coordinates > > Hi Lee Ann, > > I was pretty sure the theGlobalPoint is Top, Left relative, but wasn't sure > how to con

RE: Converting to Window Coordinates

2015-04-21 Thread Lee Ann Rucker
indward.com] Sent: Tuesday, April 21, 2015 9:46 AM To: Cocoa Developers Subject: Re: Converting to Window Coordinates Hi Lee Ann, I was pretty sure the theGlobalPoint is Top, Left relative, but wasn't sure how to convert it, I tried a few things and this seems to work: myContentView =

Re: Converting to Window Coordinates

2015-04-21 Thread Dave
Hi Lee Ann, I was pretty sure the theGlobalPoint is Top, Left relative, but wasn't sure how to convert it, I tried a few things and this seems to work: myContentView = myPhantomWindow.contentView; myGlobalPoint.x = theGlobalPoint.x; myGlobalPoint.y = NSMaxY([[[NSScreen screens] objectAtIndex:0]

RE: Converting to Window Coordinates

2015-04-21 Thread Lee Ann Rucker
How are you getting your global point? There are non-Cocoa parts of the OS that do use top-left instead of bottom-left origins, so those will need converting. From: cocoa-dev-bounces+lrucker=vmware@lists.apple.com [cocoa-dev-bounces+lrucker=vmware@