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
11
votes
5 answers

Separator item in NSPopupButton with bindings

The contents of a NSPopupButton are bound to an NSArray of strings. How can we insert a separator item via bindings? The "-" strings (like in the olden/Classic days) doesn't work, i.e. shows up literally as a "-" menu item. Is there any…
ATV
  • 4,116
  • 3
  • 23
  • 42
11
votes
3 answers

NSMenu programmatically select item

I'm writing a plugin for application - custom keyboard shortcut. I can traverse through its views. I need to open popup menu, select item in it, then open its submenu and select some item in submenu. For now I'm only able to open top popup menu by…
cody
  • 3,233
  • 1
  • 22
  • 25
10
votes
2 answers

NSPopUpButton set it to the first item

I have a clear button in my Mac OS app. When the button is pressed, it clears all the values of the form and resets the NSPopUpButton to the first item. The question is how do I change the NSPopUpButton control with code. Thanks
Cocoa Dev
  • 9,361
  • 31
  • 109
  • 177
9
votes
1 answer

NSPopUpButton Active Image

I want to create an NSPopUpButton with a custom active image. I have two images, one for inactive, and another for active. In interface builder I set the Image and Alt. Image for the NSPopUpButton. The Image is showing correctly but when I click on…
keegan3d
  • 10,357
  • 9
  • 53
  • 77
8
votes
3 answers

how to get NSPopUpButton selected object?

I'm having a student class: @interface student : NSObject{ NSString *name; NSDate *date; } and i have a NSMutableArray for list of students, and i bound it to a NSPopUpButton like this content : studentArray, arrangedObjects content…
7
votes
2 answers

SetAction for NSPopUpButton is disabling my popUpButton

I have created my NSPopUpButton programmatically with the following code [myPopUpButton insertItemWithTitle:@"--Select one--" atIndex:0]; [myPopUpButton addItemsWithTitles:[NSArray arrayWithObjects:@"1.One",@"Two",@"Three", nil]]; [myPopUpButton…
Akbar
  • 1,509
  • 1
  • 16
  • 32
7
votes
4 answers

How to add multiple menu items with the same title to NSPopUpButton(NSMenu)?

As docs say it's impossible to add two menu items to NSPopUpButton if they both have the same title. I was trying to add menu items to [popupButton menu], but with no luck. I was also trying to create a new menu, add items to it and then use…
7
votes
1 answer

How to setup bindings for NSPopUpButton

I want to bind selection of NSPopUpButton to one of the predefined values. To make it simpler, imagine a blog app: I'd have BlogPost and Category entities (Core Data, although it doesn't matter) and each BlogPost object has a link to one of the…
Tom
  • 1,522
  • 9
  • 10
6
votes
1 answer

Drop-down menu in NSToolbar like Mail.app

I'd like a toolbar button with an attached dropdown menu, like the "Flag" button in the toolbar in Mail.app: I'd hoped that making a normal NSMenuItem and adding a menu as the menuFormRepresentation would do the trick, but that menu only appears…
marcprux
  • 9,845
  • 3
  • 55
  • 72
6
votes
5 answers

How can I create a NSPopUpButton that uses a fixed Image, and no arrows?

I'm trying to get NSPopUpButton to render like a standard NSButton with only an image set, but not having any luck. Much like the "+" button in Mail.app: I assume they did this with NSPopUpButton. The obvious thing I've tried is: NSMenuItem…
d11wtq
  • 34,788
  • 19
  • 120
  • 195
6
votes
2 answers

Notification when NSPopupButton changes its value in cocoa XCode5

I want to know if is it a method different to -(void)menu:(NSMenu *)menu willHighlightItem:(NSMenuItem *)item and -(void)menuDidClose:(NSMenu *)menu to help me to know when NSPopupButton's selected value changes (for example by pressing a key…
Jesus
  • 8,456
  • 4
  • 28
  • 40
6
votes
2 answers

How do I get the selected item from NSPopUpButton?

property myPopUp : missing value on startbuttonpressed_(sender) if myPopUp's selectedItem = "Item 1" display dialog "This is Item 1" else display dialog "Failed" end if end startbuttonpressed_ I compiled this code…
subdiox
  • 387
  • 2
  • 14
6
votes
4 answers

NSPopupButton in view based NSTableView: getting bindings to work

Problem Description I'm trying to achieve something that should be simple and fairly common: having a bindings populated NSPopupButton inside bindings populated NSTableView. Apple describes this for a cell based table in the their documentation…
Lukas
  • 1,533
  • 16
  • 21
6
votes
0 answers

multiple selection of NSPopUpButton

does any know how to make a NSPopUpButton with multiple selections which is like this.
hodge
  • 125
  • 6
6
votes
5 answers

NSPopUpButton arrow color

Is there a way to customize the color of a NSPopUpButton arrow? I've looked around but I've not found an answer yet
user732274
  • 1,069
  • 1
  • 12
  • 28
1
2 3
11 12