Re: NSView doesnt receive mouseMoved events?
Re: NSView doesnt receive mouseMoved events?
- Subject: Re: NSView doesnt receive mouseMoved events?
- From: Henry McGilton <email@hidden>
- Date: Mon, 27 Jan 2003 21:00:10 -0800
On Friday, January 24, 2003, at 03:51 AM, mw wrote:
I'm not sure, but I think I had to deal with this too. You have to set
up a
tracking rectangle (NSTrackingRect, I believe. It is a structure, not a
class) in the view which will report mouse events inside the tracking
rect,
such as mouseEntered, mouseExited, mouseUp, mouseDown, mouseMoved, etc.
See Apple's docs on how to set up tracking rectangles in NSView
subclasses.
mw
On 1/24/03 3:14 AM, "Sascha Kujawa" <email@hidden> wrote:
Heya,
I am trying to find out why my subclassed NSView does not receive
mouseMoved events. Others like mouseDown work fine.
Of course I told it's window setAcceptsMouseMovedEvents:YES
but my subclassed NSView still does not receive mouseMoved
events.
You don't *have* to use tracking rectangles, although that is
one way.
This topic is covered in Cocoa Programming (thank you chaps for
saving me one hell of a lot of time on this topic). They detail
four conditions that must be met:
o you must have sent a setAcceptsMouseMovedEvents:YES to
the view's window,
o the application containing the view must be the active
application,
o the view's window must be the key window,
o the view must be the first responder.
The AppKit documentation is somewhat weak in describing these
and other such interactions.
Cheers,
........ Henry
===============================+============================
Henry McGilton | Trilithon Software
Boulevardier, Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden |
http://www.trilithon.com
===============================+============================
_______________________________________________
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.