I've tried to add NSPopupButton + CustomView, but it's not what I wanted. I would like to mimic "Tasks" on Xcode's toolbar.
Asked
Active
Viewed 1,882 times
2 Answers
0
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.

mbauman
- 30,958
- 4
- 88
- 123
-
A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](//meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted.](//stackoverflow.com/help/deleted-answers) – double-beep Apr 30 '19 at 15:58
-
Please stop deleting Stack Overflow @double-beep. – mbauman Apr 30 '19 at 16:10
-
I didn't delete Stack Overflow. This is a link-only answer, isn't it? – double-beep Apr 30 '19 at 16:11
-
No, the answer is to change the 'Type' of the NSPopUpButton to "Pull Down." – mbauman Apr 30 '19 at 16:11
-
Why do you feel the need to delete a 9 year old answer? – mbauman Apr 30 '19 at 16:12
0
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

Todd Ditchendorf
- 11,217
- 14
- 69
- 123