Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已成功将NSStatusItem添加到菜单栏,显示常规NSMenu。
是否可以在此捕获悬停事件并在这种情况下显示不同的菜单?
您需要创建一个新的自定义视图,用 [NSView addTrackingRect:...] 覆盖方法 [NSView mouseEntered:] 然后设置为状态项 [NSStatusItem setView:]