Re: Bug? Not receiving mouseEntered and mouseExited events
Re: Bug? Not receiving mouseEntered and mouseExited events
- Subject: Re: Bug? Not receiving mouseEntered and mouseExited events
- From: glenn andreas <email@hidden>
- Date: Tue, 17 Jan 2006 09:54:39 -0600
On Jan 17, 2006, at 8:58 AM, Theodore H. Smith wrote:
I have this strange situation that I am unable to receive
mouseEntered or mouseExited events.
- (void)mouseEntered:(NSEvent *)theEvent {
}
- (void)mouseExited:(NSEvent *)theEvent {
}
The same button CAN receive mouseDown: event just fine.
I am enabling mouse moved events like this, in my
NSWindowController subclass:
- (void)awakeFromNib
{
[[self window] makeFirstResponder:self];
[[self window] setAcceptsMouseMovedEvents:YES];
}
This just enables mouseMoved events (at which point your class should
receive mouseMoved: messages). What you want is tracking rectangles,
which are what causes mouseEntered:/mouseExited: to be called.
See <http://developer.apple.com/documentation/Cocoa/Conceptual/
BasicEventHandling/Tasks/HandlingMouseTracking.html#//apple_ref/doc/
uid/20000907> for all the details.
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Widgetarium | the quickest path to widgets
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden