Re: NSTabView Bindings

2009-12-22 Thread Quincey Morris
On Dec 21, 2009, at 22:02, Gerriet M. Denkmann wrote:

 
 I am trying to bind editable of an NSTableColumn to ObjectController 
 tabView.selectedIndex
 (The tab view has two items: Read and Edit. When the first item is selected, 
 my table column should not be editable).
 
 But I am told:
 [NSTabView 0x10027d010 valueForUndefinedKey:]: this class is not key value 
 coding-compliant for the key selectedIndex.
 
 On the other hand, the Cocoa Bindings Reference for NSTabView says: 
 selectedIndex
 An integer value that specifies the index of the selected item in the 
 NSTabView. When the selection changes in the NSTabView, this value is updated 
 with the index of the newly selected item.
 
 So: what is going on? 
 And: how do I make my table column editable if and only if the first tab view 
 item is selected?

selectedIndex is a binding, not a property. There is no NSTabView property 
that makes the selected tab index available directly.

The simplest way to do this is probably to create an isFirstTabSelected 
property in your window controller (tracking changes to the tab view state), 
and bind the table column's editable binding to that property.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSTabView Bindings

2009-12-21 Thread Gerriet M. Denkmann

I am trying to bind editable of an NSTableColumn to ObjectController 
tabView.selectedIndex
(The tab view has two items: Read and Edit. When the first item is selected, my 
table column should not be editable).

But I am told:
[NSTabView 0x10027d010 valueForUndefinedKey:]: this class is not key value 
coding-compliant for the key selectedIndex.

On the other hand, the Cocoa Bindings Reference for NSTabView says: 
selectedIndex
An integer value that specifies the index of the selected item in the 
NSTabView. When the selection changes in the NSTabView, this value is updated 
with the index of the newly selected item.

So: what is going on? 
And: how do I make my table column editable if and only if the first tab view 
item is selected?

Kind regards,

Gerriet.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com