NSMenuItem and NSPopOver

后端 未结 2 2122
太阳男子
太阳男子 2021-01-06 08:26

On OS X app, what is the technique to show a NSPopover when the mouse is over a NSMenuItem (like in spotlight for example).

Thanks a lot!!! Christopjhe

2条回答
  •  青春惊慌失措
    2021-01-06 08:50

    I know it's been a while, but if you still haven't found a solution:

    Register your class as a NSMenuDelegate to the menu that contains the NSMenuItem, and implement

    - (void)menu:(NSMenu *)menu willHighlightItem:(NSMenuItem *)item;
    

    then show the popover when this method is called.

提交回复
热议问题