Re: Current mouse screen?
Re: Current mouse screen?
- Subject: Re: Current mouse screen?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Sun, 18 Apr 2004 11:42:52 +0200
At 10:51 Uhr -0700 17.04.2004, Shaun Wexler wrote:
On Apr 17, 2004, at 10:16 AM, Ondra Cada wrote:
Anybody knows how to find the screen the mouse is currently on? The
position is easy ([NSEvent mousePosition]), but I did not succeed to
find the screen...
NSPoint mouseLoc = [NSEvent mouseLocation];
NSEnumerator *screenEnum = [[NSScreen screens] objectEnumerator];
NSScreen screen;
while ((screen = [screenEnum nextObject]) &&
!NSMouseInRect(mouseLoc, [screen frame], NO));
Usual disclaimers apply; written in Mail.app.
That should be NSPointInRect() instead of NSMouseInRect(), AFAIK.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.