Re: Mousemove event in NSView?
Re: Mousemove event in NSView?
- Subject: Re: Mousemove event in NSView?
- From: Thilo Ettelt <email@hidden>
- Date: Mon, 3 Jun 2002 13:06:45 +0200
Thank you! My mistake was that I typed mouseMove instead of mouseMoved...
- Cheers, Thilo
Am Montag den, 3. Juni 2002, um 12:12, schrieb Matthew:
From: Matthew <email@hidden>
Date: Thu May 23, 2002 05:59:28 PM US/Eastern
To: Marcos Tirao <email@hidden>
Subject: Re: MouseMoved
Thilo -
Here is one solution: make a NSView in your window and subclass it -
and make sure that it is the first responder. Test to make sure that
the window is getting the setAcceptsMouseMovedEvents message ok. It
seems like you shouldnt have to be the first responder to get mouse
moved events - I could see where you might want to track them in views
that arent the first responder - but thats the way it is.
hope this helps,
Matthew
(from within your NSView subclass' 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");}
}
- (void)mouseMoved: (NSEvent *)theEvent {
NSLog(@"mouseMoved working");
}
- (BOOL) acceptsFirstResponder {
return YES;
}
On Saturday, June 1, 2002, at 02:19 PM, Thilo Ettelt wrote:
Hi! I subclassed an NSView. I can I make it receive a MouseMove Event?
And does the code in the subclass look like this then: -
(void)mouseMove:(NSEvent *)theEvent ?
Thanks in advance!
- Thilo
_______________________________________________
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.
_______________________________________________
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.