Questions tagged [nspopupbutton]

The NSPopUpButton class defines objects that implement the pop-up and pull-down menus of the graphical user interface.

The NSPopUpButton class defines objects that implement the pop-up and pull-down menus of the graphical user interface. An NSPopUpButton object uses an NSPopUpButtonCell () object to implement its user interface.

Inherits from NSButton : NSControl : NSView : NSResponder : NSObject.

References:

179 questions
5
votes
1 answer

How to display an NSMenu embedded in a NSPopover?

Is there a way to have an NSMenu like object displayed as content of a NSPopover? Essentially I'd like to reproduce what macOS Dock does when you right click on an app icon (I don't mind about the dark background here, I'm only interested in having…
ggould75
  • 880
  • 2
  • 14
  • 23
5
votes
1 answer

Xcode_OSX/Swift_NSPopUpButton.

I am incredibly new to this, so please keep that in mind! I've been at this all night, watched countless videos/haunted countless forums...I can't find one single answer! I am trying to make a basic popup menu in Swift/OSX What I need to figure…
maplecobra
  • 61
  • 1
  • 2
5
votes
1 answer

Display selected sub-menuItem in NSPopUpButton

I have filled my NSPopUpButton with menu and submenus. When I select a menuItem on the root menu (so, not a sub-menuItem), it propery displays the menuItem selected. And when I re-click on the popUp button, I get the selected menuItem under the…
Leonardo
  • 751
  • 8
  • 15
5
votes
3 answers

How to change the background color of an NSPopupButton?

I am trying to tackle a problem which sounds pretty simple: changing the background color of an NSPopupButton. Interface Builder only allows changing the style to a pre-defined one and doesn't allow changing the background color. Also, setting up…
Aamir
  • 5,324
  • 2
  • 30
  • 47
4
votes
3 answers

Create NSPopUpButton Programmatically

How can I create an NSPopUpButton programmatically and attach the menu items to it? This is what I have so far but it is not click able nor does it have any menu items attached help window is just the name of my NSWindow NSPopUpButton *button =…
Grant Wilkinson
  • 1,088
  • 1
  • 13
  • 38
4
votes
2 answers

calling an action on clicking NSPopupButton

I have a NSPopupButton that displays a drop down menu when clicked. This menu is populated from an NSArray. Now if I click on one of the items in the drop down Menu, I can select it and determine what is selected etc. What I want to do is when the…
cocoacoder
  • 381
  • 8
  • 19
4
votes
1 answer

Changing visibility of NSPopUpButton's items based on keypress

I've got an application here that needs to read in a bunch of data from an external file and display it as a NSPopUpButton in a Cocoa user interface. The catch here is that the data that is being read in needs to have a flag that states if it is…
user1004332
4
votes
1 answer

NSPopUpButton placeholder value?

Notice in Xcode's symbols list (the NSPopUpButton directly above the editor, to the right of the recently edited documents), it shows when you're out of scope of any symbols it lists, but then when you click on it that option is…
d11wtq
  • 34,788
  • 19
  • 120
  • 195
4
votes
0 answers

Dealing with out-of-model menu items in NSPopUpButton

It is trivial to setup NSPopUpButton's menu via binding with an NSArrayController. A slightly more complicated, but very frequent use case, is to use NSContentPlacementTagBindingOption to insert the array items into the menu from a specified index.…
Daniel Farrell
  • 9,316
  • 8
  • 39
  • 62
4
votes
1 answer

NSPopUpButton of type pull Down , when i click on some menu item ,title of popup is not getting changed

Problem: Take an instance of NSPopupButton of type Pull down. Add few menu items to the pop up. Run the code. Select any menu item in the popup Title of popup button is not getting changed. I need to show the selected item as title of Popup same…
Neelam Verma
  • 3,232
  • 1
  • 22
  • 33
4
votes
1 answer

Show folders in NSPopUpButton

I want to show folders with icons in my NSPopUpButton. It is common for popups that used for selecting path for file. I'm new user and i can't post images. U can see that for example in U Torrent->preferences->directories Please provide detailed…
Ankoma
  • 127
  • 1
  • 4
4
votes
1 answer

NSPopupButton Bindings with Value Transformer

I don't know if what I see with a popup button populated by bindings with a value transformer is the way it's supposed to be or not -- the unusual thing I'm seeing (at least with respect to what I've seen with value transformers and table views) is…
rdelmar
  • 103,982
  • 12
  • 207
  • 218
4
votes
2 answers

How to populate NSPopupButton from CoreData in View Based NSTableView

I am using view based NSTableViews that is populated using bindings and array controllers with core data. Everything works great--cells with text and buttons and cells with image and text--I can edit the text as well, etc. What I can't figure out…
pahladan
  • 41
  • 1
  • 3
3
votes
1 answer

Custom view in NSMenuItem disables the NSPopUpButton selection

I want to customize an an NSPopUpButton so I have implemented an CustomMenuItemView which right now only has the following code (for testing purposes): - (void)drawRect:(NSRect)dirtyRect { [[NSColor redColor] set]; …
pajevic
  • 4,607
  • 4
  • 39
  • 73
3
votes
1 answer

Control NSMenuItem inset/padding?

Is it possible to control the inset or padding for NSMenuItems? I.e. for a menu used in my NSPopupButton I'd like to remove the left padding (normally used for the checkbox) and add some padding after the text. Can this be achieved (with public…
cacau
  • 3,606
  • 3
  • 21
  • 42
1
2
3
11 12