NSButton not responding to mouseEntered: ?
NSButton not responding to mouseEntered: ?
- Subject: NSButton not responding to mouseEntered: ?
- From: "Theodore H. Smith" <email@hidden>
- Date: Mon, 16 Jan 2006 16:38:53 +0000
I got this code in an NSButton subclass:
- (void)mouseEntered:(NSEvent *)theEvent {
...
}
I tried enabling tracking rects for the button, using [self
visibleRect] as the rect, but that just went totally screwy. It
seemed almost random. I could move a mouse button over one button,
and get two buttons receiving mouseEntered events! Even thoguh the
buttons did not overlap. And moving the cursor within one button
would generate both leave and entered events, despite that the mouse
did NOT leave or enter the button.
So I decided to skip that complexity, and just stick with letting the
window do the tracking. I used this code:
[[c window] setAcceptsMouseMovedEvents:YES];
[c window] is the window that owns this NSButton subclass.
So, theoretically, I should get mouseEntered: called. Except, that it
doesn't. It never gets called.
Why??
What am I doing wrong? I verified that acceptsMouseMovedEvents is
equal to true, so according to the documentation, it ought to be
working already. What is wrong?
_______________________________________________
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