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
0
votes
0 answers

Is there a way to make NSMenuItem representing a dictionary in Swift?

When a user selects a menu item in NSPopUpButton, I want this item to be representing a dictionary, not just its String value, but still displaying a String. I created a for-in loop to compare dictionaries, but I want to compare only dictionaries…
0
votes
1 answer

Swift // NSPopUpButton .addingItems() problems

I searched a lot but I didn't find anything.. I'm relatively new to the programming world, and I am writing a little macOS software on Xcode. But there is the problem : I want to add items to a pop-up menu n°2 (NSPopUpButton) after clearing the menu…
0
votes
2 answers

NSPopUpButton selection to Float Swift 4

I am trying to get a String value to a Float value from a NSPopUpButton. E.g. I have 3 number selections. 50, 20, 10. When the user selects one of the numbers I would like a calculation made into a Float value. I know this may be something very…
Costa
  • 39
  • 6
0
votes
1 answer

How to access and sort NSTableView with NSPopUpButton using Swift

To keep it simple, I used this URL to create a macOS table in Swift (4.1): https://medium.com/@kicsipixel/very-simple-view-based-nstableview-in-swift-ab6d7bb30fbb I then used this URL to be able to drag and drop rows in the…
0
votes
2 answers

How do I preselect an item in NSPopUpButton bound to core data?

I have an NSPopUpButton with bindings to core data. I need to preselect an item in the list dynamically when the view is loaded. Is there a way to get a notification when the NSArrayController is ready? Or any other way to do it?
sbenitezb
  • 536
  • 7
  • 21
0
votes
1 answer

osx NSPopUpButton Notification after Selection

I need to know the user selection after the user changed the item from a NSPopUpButton. Why on earth does the NSPopUpButton control has a notification before the user action.: Posted when an NSPopUpButton object receives a mouse-down event—that is,…
JFS
  • 2,992
  • 3
  • 37
  • 48
0
votes
1 answer

Straightforward way to implement custom drawn NSMenuItem views

I would like to have a NSMenu with several NSMenuItems in it. Those items shall behave just like "normal" NSMenuItems, with one exception: I would like to be able to draw the contents (i.e. the "foreground") of each item on my own. That is: I would…
phimuemue
  • 34,669
  • 9
  • 84
  • 115
0
votes
1 answer

NSCollectionView as NSPopUpButton "drawer"

I would like to have something similar to the "List mode" of the stacks in the Dock. But it should have the behavior of NSPopUpButton, in terms of displaying the selected object still, when the "drawer" is collapsed. Each row should contain an…
bijan
  • 1,675
  • 18
  • 30
0
votes
1 answer

populate an NSPopupButton with thousands of items

I have a unique case where I need to populate a menu with thousands of items from an sqlite database... I am currently filling it with the following code, but it blocks the main thread while its populating, and takes upwards of a minute to load (the…
gypsyDev
  • 1,232
  • 1
  • 14
  • 22
0
votes
1 answer

NSArrayController, View Based Table, NSPopUpButton and Bindings

I am trying to bind a NSPopUpButton in a view based NSTableView with NSArrayContollers using Xcode 8.1. I have an macOS app that had been using a cell based NSTableView and I would like to convert it to a view based table, however, I have been…
0
votes
1 answer

Tiered NSPopupButton binding

I'm trying to have two NSPopupButton that are linked to each other and am having issues with the bindings on the 'child' button. I have three Core Data entity types: Order, Client, and Station. Station -> Client is a many-to-1, so a Client has…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
0
votes
1 answer

NSMenuItem image color becomes dark when selected

I am using NSPopUpButton with title and image. Below is my code: [self.popup addItemWithTitle:@"Parag"]; [[self.popup lastItem] setImage:[NSImage swatchWithColor:[NSColor greenColor] size:NSMakeSize(10.0, 10.0)]]; Creating NSImage from…
Parag Bafna
  • 22,812
  • 8
  • 71
  • 144
0
votes
0 answers

Custom view for NSPopupButton NSMenu

I'm having some problems setting a custom NSView for my NSPopupButton menu items. Here is what I've got so far: @interface ViewController () @property (weak) IBOutlet NSPopUpButton *popupButton; @end @implementation ViewController -…
zic10
  • 2,310
  • 5
  • 30
  • 55
0
votes
1 answer

NSPopUpButton revert to initial state

I register for notification NSPopUpButtonWillPopUpNotification in order to change the pop up menu before it is shown. The new pop up menu consist of running Application list with respected icons. When the application is selected, it calls a…
Dan
  • 1,711
  • 1
  • 22
  • 36
0
votes
0 answers

Cocoa two-tier popup binding

I have three NSObject subclasses: Order, Station, and Client. The Order has a pointer to Station and Client. On my order editor form I've got NSPopupButtons for both Station and Client, and those are bound successfully to NSArrayControllers. …
Gargoyle
  • 9,590
  • 16
  • 80
  • 145