RE: Converting to Window Coordinates
RE: Converting to Window Coordinates
- Subject: RE: Converting to Window Coordinates
- From: Lee Ann Rucker <email@hidden>
- Date: Wed, 22 Apr 2015 22:06:00 +0000
- Thread-topic: Converting to Window Coordinates
Possibly +[NSWindow windowNumberAtPoint:belowWindowWithWindowNumber:], but then you'd still need to loop through your windows to find the one with the matching windowNumber.
________________________________________
From: cocoa-dev-bounces+lrucker=email@hidden [cocoa-dev-bounces+lrucker=email@hidden] on behalf of Dave [email@hidden]
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 <email@hidden> 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 space now, use NSPointInRect on the window frame.
Ok, but I still have to loop through my windows, there is no method I can call that will return the window for the point directly? e.g.
myWindow = [<something> getWindowForScreenPoint:thePoint);
it’s no big deal and I have it working already, it’s just if there is a system method then I may as well use it.
All the Best
Dave
_______________________________________________
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
_______________________________________________
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