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
3
votes
2 answers

NSPopUpButton White text

I have created a NSPopUpButton in my app in a custom view which has a black fill. I would now like to make the NSPopUpButton have a white text color but I do not seem to be able to do this. How should I go about doing this? Thanks
Tom Coomer
  • 6,227
  • 12
  • 45
  • 82
3
votes
4 answers

A popup button with a static image (Cocoa OSX)

I am trying to make a popup button that always displays a + as its image and when you click on it, a context menu pops up that will allow you to decide what type of object you want to add. Is there anyway to do this using an NSPopupButton? I saw…
Mike2012
  • 7,629
  • 15
  • 84
  • 135
3
votes
1 answer

Swift: Getting indexOfSelectedItem of NSPopUpButton

In objc, I can get the selectedItem, titleOfSelectedItem and indexOfSelectedItem of an NSPopUpButton: - (IBAction) myPopUpButton: (id)sender { NSLog( [sender selectedItem] ); // works NSLog( [sender titleOfSelectedItem] ); // works …
user1890913
  • 107
  • 6
3
votes
1 answer

How to set NSPopUpButton's menu's position?

I need to set a custom position to the NSMenu of a NSPopUpButton object. The default position looks like this: But I want it to look like this:
gabriel_vincent
  • 1,230
  • 3
  • 16
  • 35
3
votes
2 answers

How to do an on-item-changed for an NSPopUpButton?

I'm trying to implement a system that changes a label based on the state of an NSPopUpButton. So far I've tried to do what's displayed in the code below, but whenever I run it, the code just jumps into the else clause, throwing an alert -…
Electric Coffee
  • 11,733
  • 9
  • 70
  • 131
3
votes
3 answers

NSPopupButton within a view-based NSTableView

I am using core data, with an up-to-date XCode. I have a table, view-based, with NSPopupButtons in one of the columns. The table has an array controller that gets its data from entity A. There is another array controller for entity B. It is this…
Carelinkz
  • 936
  • 8
  • 27
3
votes
2 answers

Resize NSPopupButton to its selected title

I've a NSPopupButton and I want it so resize itself to fit the selected title. [NSPopupButton sizeToFit] doesn't fit my needs because the popup is resized to the largest title item not to the current selected one I've tried in may ways without…
dafi
  • 3,492
  • 2
  • 28
  • 51
3
votes
0 answers

How refresh menu of NSPopupButton programmatically?

This is a Core Data app made of several views, each contained in its own Xib. Across the app, I have several NSPopupButton displaying data from various Core Data entities, with bindings done the traditional way in interface builder and all works…
user886832
3
votes
1 answer

How to properly use NSPopUpButton

I have a NSPopUpButton that I want to use to select the text encoding for opening a file. I already have some ideas how to implement this, but as I'm starting to learn Objective-C and Cocoa I'm almost sure that there is a better way to accomplish…
3
votes
1 answer

NSPopUpButton + Bindings + Show All Option

I'm trying to develop a NSPopUpButton that will serve as a filter to some datasource, let's say a NSArrayController that fills a table. I can bind the NSArrayController from the menu to the selection keypath so the data is properly filtered, no…
2
votes
3 answers

Swift: Why does "Pop Up Button" throw NSInternalInconsistencyException?

I created a "Pop Up Button" following the WWDC video here: "Build interfaces with style" https://developer.apple.com/videos/play/wwdc2021/10196/?time=602 After adding the pop up button like shown in the video, I created an IBAction function like…
RainCast
  • 4,134
  • 7
  • 33
  • 47
2
votes
0 answers

NSMenuItem actions overriding NSPopUpButton actions

I've noticed an interesting behavior and I wonder if it's something I'm doing wrong. I have an NSPopUpButton with several NSMenuItems on an NSMenu on the NSPopUpButton. When I click the popup button and select an item the action that I've linked to…
JPC
  • 8,096
  • 22
  • 77
  • 110
2
votes
2 answers

How can I limit the "pop-up" size of NSPopUpButton?

I have a large list - over 200 items - managed by an NSPopUpButton. When clicked, the list extends all the way to the top or bottom of the screen and beyond. How can I limit the open size, so that at most 20 or so items are shown at once?
Mira
  • 161
  • 7
2
votes
1 answer

Binding a NSPopupButton's selected identifier

I have several popup buttons whose selected tag is saved in the user defaults (by binding the selected tag in the Bindings inspector). Now instead of saving an integer I would like to save a string value (for the simple reason that it makes the user…
Nickkk
  • 2,261
  • 1
  • 25
  • 34
2
votes
1 answer

binding NSPopupbutton to an array of classes

I'm having difficulty binding a NSPopUpButton to an NSArrayController. The array controller manages an array (plants) of the the class Plant, which has a property named commonName which should be listed in the button. I've searched for several days…
Pam
  • 23
  • 2
1 2
3
11 12