NSTrackingArea does not work in Today extension
| Originator: | brent | ||
| Number: | rdar://17515876 | Date Originated: | 30-Jun-2014 07:37 PM |
| Status: | Duplicate/16916572 | Resolved: | |
| Product: | OS X | Product Version: | Mac OS X 10.10 (14A238x) |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
If an NSTrackingArea is attached to a view in a Today extension (or, I’m told, any extension at all), the various methods it is supposed to call on its owner are never called.
Steps to Reproduce:
1. Create a Mac project with a Today extension.
1. Write an NSButton subclass with code like this:
var highlightTrackingArea: NSTrackingArea!
override func updateTrackingAreas() {
super.updateTrackingAreas()
removeTrackingArea(highlightTrackingArea)
highlightTrackingArea = NSTrackingArea(rect: bounds, options: .MouseEnteredAndExited | .ActiveAlways, owner: self, userInfo: nil)
addTrackingArea(highlightTrackingArea!)
}
override func mouseEntered(theEvent: NSEvent!) {
super.mouseEntered(theEvent)
println(“In mouseEntered”)
}
override func mouseExited(theEvent: NSEvent!) {
super.mouseExited(theEvent)
println(“In mouseExited”)
}
3. Set breakpoints in those three methods if desired.
4. Add an instance of that NSButton subclass to the extension’s nib file.
5. Run the extension and mouse over the button.
Expected Results:
mouseEntered() and mouseExited() are called as appropriate.
Actual Results:
These methods are not called.
Notes:
I would like to have a button in my extension that changes appearance (replacing one icon with another) when moused over, but this is not currently possible because of this bug.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!