• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSButton not responding to mouseEntered: ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: NSButton not responding to mouseEntered: ?
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: create a graph with cocoa
  • Next by Date: Re: NSTextView keydown alternative?
  • Previous by thread: Re: "Modal" Window
  • Next by thread: Re: NSButton not responding to mouseEntered: ?
  • Index(es):
    • Date
    • Thread