开发者

How to add popup menu on NSToolbar item?

开发者 https://www.devze.com 2022-12-18 08:16 出处:网络
I\'ve tried to 开发者_Python百科add NSPopupButton + CustomView, but it\'s not what I wanted. I would like to mimic \"Tasks\" on Xcode\'s toolbar.You want to change the \'Type\' of the NSPopUpButton to

I've tried to 开发者_Python百科add NSPopupButton + CustomView, but it's not what I wanted. I would like to mimic "Tasks" on Xcode's toolbar.


You want to change the 'Type' of the NSPopUpButton to "Pull Down."

Here's a great video demonstration on precisely what you're looking for: http://www.youtube.com/watch?v=Qr6EX-JIZZU.


Hey Irwan, I have code that does this in my Fluidium project on GitHub.

Behavior: Standard NSToolbarItem that is an NSButton. When you click and hold on the button, it pops up an NSMenu after a short delay.

Basically identical to Xcode:

http://github.com/itod/fluidium/blob/master/Fluidium/src/FUBackForwardPopUpButton.m

0

精彩评论

暂无评论...
验证码 换一张
取 消