Show NSPopover from NSToolbarItem Button

后端 未结 4 1046
孤城傲影
孤城傲影 2021-02-08 12:50

I want to show an NSPopover from an NSToolbarItem button in my toolbar.
(i.e. positioned below the button).

Ideally, I want to pass the

4条回答
  •  萌比男神i
    2021-02-08 13:42

    The answer appears to be in the video for the 2011 WWDC Session 113, "Full Screen and Aqua Changes." Basically, put an NSButton inside the NSToolbaritem and use the view of that.

    A blog post is here: http://www.yellowfield.co.uk/blog/?p=33, and a sample project is on github at http://github.com/tevendale/ToolbarPopover

    All in the sprit of http://xkcd.com/979!

提交回复
热议问题