Re: How do I implement isPointObscured?
Re: How do I implement isPointObscured?
- Subject: Re: How do I implement isPointObscured?
- From: Eric Schlegel <email@hidden>
- Date: Thu, 13 Oct 2005 11:20:18 -0700
On Oct 13, 2005, at 9:43 AM, Jonathan del Strother wrote:
I need to tell if a point in my view is obscured by other
application's windows. From the docs for -[NSWindow isVisible] :
> Returns YES if the receiver is onscreen (even if it’s obscured by
other windows).
OK, so there doesn't appear to be a built-in method. Any
suggestions on implementing it? AFAICT there's no way of getting a
system-wide list of windows within the Cocoa API, so maybe this is
to the wrong mailing list. Is Carbon the best way of doing this?
If Accessibility is enabled, I think you could query the global
accessible object for the child at a specified point, and then
determine whether the resulting window was part of your app or some
other app.
The Carbon FindWindow API should also return NULL if the point falls
in a window that is not part of a WindowRef of the current process,
but since Cocoa windows don't get Carbon WindowRefs created by
default, I'm not sure that would help you. It's possible that if you
explicitly called [myNSWindow windowRef] on each of your NSWindows,
that would be enough to force creation of the WindowRef and give you
the right info, but I haven't tried that.
-eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden