Reputation: 1700
I am trying to expand NSPopUpButton
with Swift. For a native OSX app, I have to override a design like a screenshot below.
My purpose is adding a button as with down_icon
and when I click it the popup button must expand. I can't do it in NSPopUpButton
but in this question thread, this is possible for NSComboBox
. Question Here
As I tried in NSComboBox,
comboBoxCell.performSelector(Selector("popUp:"))
code block not worked for NSPopUpButton
because of there is no selector for NSPopUpButton for popping up.
Also, try
phoneCodesPopup.setAccessibilityExpanded(true)
but it is not expanded.
How can I open NSPopUpButton
programmatically?
Thanks in advance!
Upvotes: 0
Views: 599
Reputation: 271420
Unlike NSComboBox
, clicking on NSPopoverButton
, anywhere, will make it pop up, so you just need performClick
:
yourPopup.performClick(nil)
Upvotes: 1