Skip navigation.
 
mlRe: acceptsMouseMovedEvents?
FROM : Brian O'Brien
DATE : Wed Apr 27 23:11:32 2005

On Apr 27, 2005, at 2:44 PM, Clark Cox wrote:

> On 4/27/05, Brian O'Brien <<email_removed>> wrote:

>>
>> On Apr 27, 2005, at 2:32 PM, Brian O'Brien wrote:
>>

>>> In my subclass of NSImageView I want to receive mouse move events.
>>> I defined the method acceptsMouseMovedEvents and returned true.
>>> I also defined the method - (void)mouseMoved:(NSEvent *)theEvent
>>> and put an NSLog message in that function. However I get no mouse
>>> motion events.
>>>

>>
>> in my init I did
>> [[self window] setAcceptsMouseMovedEvents:YES];

>
> While inside you're init method, [self window[ cannot possibly be
> returning anything other than nil. That is, if the view's still being
> init'ed, it can't have been placed in a superview yet.
>

I got tracking rects working and I also got mouseEntered and
mouseExited events...
I figured I could add [[self window] setAcceptsMouseMovedEvents:YES] in
the
entered event and turn them off in the exited event... but still no
mouseMoved events...

Related mailsAuthorDate
mlacceptsMouseMovedEvents? Brian O'Brien Apr 27, 22:32
mlRe: acceptsMouseMovedEvents? Brian O'Brien Apr 27, 22:39
mlRe: acceptsMouseMovedEvents? Geoff Levner Apr 27, 22:40
mlRe: acceptsMouseMovedEvents? Brian O'Brien Apr 27, 22:44
mlRe: acceptsMouseMovedEvents? Clark Cox Apr 27, 22:44
mlRe: acceptsMouseMovedEvents? Brian O'Brien Apr 27, 23:11
mlRe: acceptsMouseMovedEvents? glenn andreas Apr 27, 23:26
mlRe: acceptsMouseMovedEvents? Brian O'Brien Apr 27, 23:41