问题
How do I execute a function when a user's mouse hovers over my NSStatusItem?
回答1:
If you assign a custom NSView
to your NSStatusItem
's view
property, you can override the NSResponder
methods mouseEntered:
, mouseMoved:
and mouseExited:
.
来源:https://stackoverflow.com/questions/5114974/cocoa-capturing-nsstatusitem-mouse-hover-event