Re: Questions about NSPopupButtonCell and NSBrowser

2015-07-19 Thread Frank D. Engel, Jr.
In case anyone else is struggling with popup button cells like I was, I did finally get this to work - though the solution looks a bit strange it definitely seems to be giving me the behavior I wanted. Short version: there are two entities defined (Core Data) and there is a one-to-many relat

Re: Questions about NSPopupButtonCell and NSBrowser

2015-06-04 Thread Graham Cox
> On 5 Jun 2015, at 9:59 am, Frank D. Engel, Jr. wrote: > > > If I don't bind from there, I'm not sure where else to do it from? In IB, in -awakeFromNib, in -windowDidLoad: (in a window controller), etc? Anywhere but in the drawing pathway. I’m not sure whether bindings only makes single co

Re: Questions about NSPopupButtonCell and NSBrowser

2015-06-04 Thread Frank D. Engel, Jr.
On 6/4/2015 19:39, Graham Cox wrote: On 5 Jun 2015, at 9:19 am, Frank D. Engel, Jr. wrote: - (void)browser:(NSBrowser *)browser willDisplayCell:(MyBrowserCell *)cell atRow:(NSInteger)row column:(NSInteger)column { // Find the item and set the image. WhateverObject *c = [browser item

Re: Questions about NSPopupButtonCell and NSBrowser

2015-06-04 Thread Graham Cox
> On 5 Jun 2015, at 9:19 am, Frank D. Engel, Jr. wrote: > > - (void)browser:(NSBrowser *)browser willDisplayCell:(MyBrowserCell *)cell > atRow:(NSInteger)row column:(NSInteger)column > { > // Find the item and set the image. > WhateverObject *c = [browser itemAtRow:row inColumn:column];

Re: Questions about NSPopupButtonCell and NSBrowser

2015-06-04 Thread Frank D. Engel, Jr.
On 6/4/2015 18:43, Graham Cox wrote: On 5 Jun 2015, at 6:38 am, Frank D. Engel, Jr. wrote: On 6/3/2015 20:29, Graham Cox wrote: On 4 Jun 2015, at 10:20 am, Frank D. Engel, Jr. wrote: I am wondering if the browser is actually caching an image of the cells in the second column when I switc

Re: Questions about NSPopupButtonCell and NSBrowser

2015-06-04 Thread Graham Cox
> On 5 Jun 2015, at 6:38 am, Frank D. Engel, Jr. wrote: > > > On 6/3/2015 20:29, Graham Cox wrote: >>> On 4 Jun 2015, at 10:20 am, Frank D. Engel, Jr. wrote: >>> >>> I am wondering if the browser is actually caching an image of the cells in >>> the second column when I switch away, then just

Re: Questions about NSPopupButtonCell and NSBrowser

2015-06-04 Thread Frank D. Engel, Jr.
On 6/3/2015 20:29, Graham Cox wrote: On 4 Jun 2015, at 10:20 am, Frank D. Engel, Jr. wrote: I am wondering if the browser is actually caching an image of the cells in the second column when I switch away, then just displaying that without actually recreating the cells in the second column un

Re: Questions about NSPopupButtonCell and NSBrowser

2015-06-03 Thread Graham Cox
> On 4 Jun 2015, at 10:20 am, Frank D. Engel, Jr. wrote: > > I am wondering if the browser is actually caching an image of the cells in > the second column when I switch away, then just displaying that without > actually recreating the cells in the second column until it needs one of them > f

Re: Questions about NSPopupButtonCell and NSBrowser

2015-06-03 Thread Frank D. Engel, Jr.
After all of this, I finally at least partially solved this one. I added a line of code to run each time that method is called. It wasn't being called most of the time. I found where I was calling this and changed the code a bit to use a binding created by code, and now it is almost working.

Re: Questions about NSPopupButtonCell and NSBrowser

2015-06-03 Thread Frank D. Engel, Jr.
I based my code on one of Apple's examples and had tried using NSBrowserCell but was not able to get that working; I assume there is some reason why Apple chose to use NSTextFieldCell in their example and I followed suit. Currently, I have this coded - I had tried several variations to force

Re: Questions about NSPopupButtonCell and NSBrowser

2015-06-03 Thread Graham Cox
> On 4 Jun 2015, at 7:29 am, Frank D. Engel, Jr. wrote: > > Now what I am hoping is the simpler one: > > I have a custom subclass of NSTextFieldCell which I am using to show an icon > in an NSBrowser. The icon image is being generated dynamically by a method > in my subclass and I want it to

Questions about NSPopupButtonCell and NSBrowser

2015-06-03 Thread Frank D. Engel, Jr.
I have two questions I'm hoping I can get some advice on... First the complicated one: I have an NSTableView (cell-based) in which I am trying to rig two columns with NSPopupButtonCell - the selection in the first one determines the possible values of the second. This is part of a document