nspopupbuttoncell

How do I force an NSPopUpButtonCell to redisplay itself?

I'm creating a custom subclass of NSPopUpButton and NSPopUpButtonCell to display a lone icon on top of the button instead of the usual text. To do this I'm overriding - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView in my button cell subclass to draw my icon at the appropriate size and location. When the ...

NSPopUpButtonCell inside custom cell does not pop up when clicked.

I've created a custom subclass of NSCell with an NSImageCell, some NSTextFieldCells, and an NSPopUpButtonCell. I'm initializing the pop up cell using: myPopUpCell = [[NSPopUpButtonCell alloc] init]; [myPopUpCell setBordered:NO]; [myPopUpCell setAutoenablesItems:NO]; [myPopUpCell addItemsWithTitles:[NSArray arrayWithObje...

NSPopUpButtonCell inside custom NSCell does not change selection when item is selected from menu

I have an NSPopUpButtonCell inside a custom NSCell and I'm using - (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView to produce the pop up menu when it's clicked. I have also overridden copyWithZone: in my custom cell to copy the popUpCell instance variable so that each row in my table view has its own pop up ce...

After selecting item in NSPopUpButtonCell inside custom NSCell table view must be refocused

I have an NSPopUpButtonCell inside a custom NSCell which is being used in an NSTableView. I'm using - (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView to pop up the pop up menu when it is required. The problem is that after an item is selected from the menu the table view seems to lose focus, such that it must...

How do I manually highlight an NSPopUpButtonCell when drawing it (draw it using white instead of black)?

I've got a custom cell composed out of several cells, one of which is an NSPopUpButtonCell. When drawing my custom cell highlighted, I want to cause all the sub-cells to highlight as well (typically by turning white). With, for example an NSTextCell, if I call setHighlighted:YES before calling drawWithFrame:inView the cell will be draw...

NSTableView and NSPopUpButtonCell: How to detect when inline editing stops?

In my application, I use a NSTableView in which I allow inline editing. This inline editing is "buffered", which means that the user has to tab through all fields or press return to "commit" the edit. Pressing escape cancels the edit and reverts values. Up until now, I only needed text fields for inline editing, and I am successfully ab...

NSPopupButton, updates depending on another NSPopupButton

Hi all, I wish to make a city/country selector using 2 NSPopupButtons. One popup button will contain the first part e.g. UK, and the second one will contain the second part e.g. London So the whole city/country combo will read: UK London however, I want the second part to be updated when the first part is selected, e.g. if London is sel...

Filtering entries from a Core Data entity that appear in an NSPopUpButton list

I'm familiar with how to feed data from one Core Data entity into an NSPopUpButton item so that it can be selected for another. Bindings like so: For the values themselves: -> ValueSelection.Content Bind To: Value Source Entity Controller Key: arrangedObjects Model Key: N/A For the values displayed in the NSPopUpButton: ...

How to use NSDateFormatter with NSPopUpButton

I have an NSPopUpButton's content bound to an Array Controller of "Meeting" entities and it's content value bound to the same array controller, but to the "date" model key path. Everything works fine. But I'd like to format the way the date is displayed with an NSDateFormatter and I can't get it to work. Any hints? Is it even possible? ...

Programatically instantiating a NSPopUpButtonCell in Cocoa OSX

I have an openGL GUI interface and I need to have a popup menu that will be called when this a certain button is pressed in my openGL display. I want to display a menu similar to the one that pops up when you press an NSPopUPButton but I cannot use the Cocoa button itself. It seems that the best way to accomplish this is to use the NSP...

How do I make an NSPopupButton that has a menu with images AND text?

I have a list of applications and I'd like to make an NSPopupButton that shows a menu of application names with their icon to the left of each item. I've been able to bind the NSPopupButton to my array of items, but there isn't a binding entry for an image. I thought I could put a cell in there and bind the cell as an image and as text,...

How to configure a NSPopupButton for displaying multiple values in a TableView?

Hi there! I'm using two entities A and B with to-many-to-many relationship. Lets say I got an entity A with attribute aAttrib and a to-many relationship aRelat to another entity B with attribute bAttrib and a to-many relationship bRelat with entity A. Now I am building an interface with two tables one for entity A and another for entit...

Populating an NSPopUpButtonCell with string values

I am trying to populate a NSPopUpButtonCell with a list of strings. In -(init), I populate an NSArray with the values I want in the PopUp Button. How do I connect this to the NSArrayController I added in IB? Does my app delegate need an IBOutlet NSArrayController to connect to or is there a way to bind it? Also, when I bind the NSArr...

Simulating a button press without performClick: (cocoa osx/cocotron)

I need to be able to display popup menu when I press an openGL object. I was able to accomplish this by triggering the performClick: of an inviible NSPopupButton and also by triggering the performClickWithFrame:inView: of an NSPopupButtonCell. Both of these methods were successful on OSX but I also need to target the PC and unfortunat...

Dynamically populated NSPopUpButtonCell menu in an NSOutlineView

I’m working with an NSOutlineView which has two columns. My dataSource supplies the outline view with a tree of items of a custom class which represents file types (that is, you initialise it with a UTI). The first column is the display name of the file type (e.g., “Source code”, “Interface Builder NIB document”, etc.). The second column...

Directly accessing the NSPopupButtonCell of an NSPopupButton (Cocoa OSX)

I know this is not normally recommended but I really need to access the NSPopupButtonCell of NSPopupButton. Is there a way to do this? ...

simulating a click on cell that contains an nspopupbutton (populated with bindings) in an nstableview

I've got an application that needs to run on os x 10.6 and 10.5; there is an NSTableView that contains an NSPopUpButtonCell that is populated using an array controller. When a new item is created in the table I need to pop up the menu for the row entry automatically. I was using the method performClickOnCellAtColumn:row: which produces...

Using NSPopUpButtonCell with NSTableView

Hello I am trying to use a NSPopUpButtonCell inside an NSTableView. Basically when you select an item in the pop up I want it displayed in the table view column/row. When an item in the popup cell is pressed I store it inside the data source using "tableView:setObject:forTableColumn:row", then when the table requests data I retrieve and ...

NSPopUpButton revert to initial state

Hi, 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 @selector method. After selection completes, the button have the image of the selected appl...