Re: binding to number of selected rows in a table [solved]

2009-03-04 Thread James Walker
Jerry Krinock wrote: On 2009 Mar 04, at 11:39, James Walker wrote: * Add an NSMutableIndexSet* member to my controller, to store the selection. * Add KVO-friendly accessors for that index set. * Update the index set (using the setter) in the outlineViewSelectionDidChange: delegate method.

Re: binding to number of selected rows in a table [solved]

2009-03-04 Thread Jerry Krinock
On 2009 Mar 04, at 11:39, James Walker wrote: * Add an NSMutableIndexSet* member to my controller, to store the selection. * Add KVO-friendly accessors for that index set. * Update the index set (using the setter) in the outlineViewSelectionDidChange: delegate method. James, you've added

Re: binding to number of selected rows in a table [solved]

2009-03-04 Thread James Walker
Thanks to Jerry Krinock, Sean McBride, and Corbin Dunn for the replies. NSTreeController didn't seem to be a good fit for my data, so here's how I did it: * Add an NSMutableIndexSet* member to my controller, to store the selection. * Add KVO-friendly accessors for that index set. * Update the

Re: binding to number of selected rows in a table

2009-03-04 Thread Jerry Krinock
On 2009 Mar 04, at 08:21, Corbin Dunn wrote: Cocoa does not support binding to view properties like this. Most are not KVC compliant. But you can make them KVO-compliant as I described yesterday. It's a slight kludge, but I think of it as a necessary "bridge" from the old world of dataS

Re: binding to number of selected rows in a table

2009-03-04 Thread Corbin Dunn
On Mar 3, 2009, at 6:38 PM, James Walker wrote: I want to use bindings to set certain control attributes (enabled state, tool tip) depending on the number of selected rows in an outline table. I have a controller object that owns an NSOutlineView, and I gave it an accessor - (NSOutlineV

Re: binding to number of selected rows in a table

2009-03-04 Thread Sean McBride
On 3/3/09 6:38 PM, James Walker said: >I want to use bindings to set certain control attributes (enabled state, >tool tip) depending on the number of selected rows in an outline table. > I have a controller object that owns an NSOutlineView, and I gave it >an accessor > >- (NSOutlineView*) outlin

Re: binding to number of selected rows in a table

2009-03-03 Thread Jerry Krinock
On 2009 Mar 03, at 18:38, James Walker wrote: Are these NSOutlineView methods not KVO-friendly, or am I doing something wrong? I would say the answer to your question is "both" :)) And I also believe that you have two options: 1. Assuming you're using the "classic" dataSource to drive you

binding to number of selected rows in a table

2009-03-03 Thread James Walker
I want to use bindings to set certain control attributes (enabled state, tool tip) depending on the number of selected rows in an outline table. I have a controller object that owns an NSOutlineView, and I gave it an accessor - (NSOutlineView*) outlineView; Then I tried to bind to my control