Re: Getting 'mouseMoved' events
Re: Getting 'mouseMoved' events
- Subject: Re: Getting 'mouseMoved' events
- From: James Pengra <email@hidden>
- Date: Wed, 22 May 2002 13:57:53 -0700
Matthew kindly responded:
(from within your NSView's awakeFromNib method - if you are using nibs)
- (void)awakeFromNib
{
[[self window] makeFirstResponder: self];
[[self window] setAcceptsMouseMovedEvents: YES];
if ([[self window] acceptsMouseMovedEvents]) {NSLog(@"window now
acceptsMouseMovedEvents");}
}
It was setting the FirstResponder that was necessary to make the
call to mouseMoved work as expected.
I thought I had this set properly in the Nib file where I had set
the View within the Window to be the first responder. However, there
seems to be a distinction between the View and the Window when it
comes to selecting a FirstResponder, at least as far as mouseMoved
events are concerned. As I said earlier, mouseDown events worked
without any additional specification of the first responder.
I did not follow Matt's suggestion to make the call to
setAcceptsMouseMovedEvents in the awakeFromNib method because of the
warnings not to flood the Event queue with mouseMoved events. I turn
that on just when I need it and then off when I'm done.
Thanks also to John H. and Matt N. for helpful ideas.
--Jim
_______________________________________________
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.