mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 19:20:37 +00:00
Update _setObjectValue:...
This commit is contained in:
parent
fdb35eb869
commit
060b27a854
1 changed files with 24 additions and 7 deletions
|
@ -1921,15 +1921,32 @@ Also returns the child index relative to this parent. */
|
||||||
forTableColumn: (NSTableColumn *)tb
|
forTableColumn: (NSTableColumn *)tb
|
||||||
row: (NSInteger) index
|
row: (NSInteger) index
|
||||||
{
|
{
|
||||||
if ([_dataSource respondsToSelector:
|
// If we have content binding the data source is used only
|
||||||
@selector(outlineView:setObjectValue:forTableColumn:byItem:)])
|
// like a delegate
|
||||||
|
NSDictionary *info = [GSKeyValueBinding infoForBinding: NSValueBinding forObject: tb];
|
||||||
|
if (info != nil)
|
||||||
{
|
{
|
||||||
id item = [self itemAtRow: index];
|
id theItem = [_items objectAtIndex: index];
|
||||||
|
NSString *ikp = [info objectForKey: @"NSObservedKeyPath"];
|
||||||
|
NSUInteger location = [ikp rangeOfString: @"."].location;
|
||||||
|
NSString *keyPath = (location == NSNotFound ? ikp : [ikp substringFromIndex: location + 1]);
|
||||||
|
|
||||||
[_dataSource outlineView: self
|
// Set the value on the keyPath.
|
||||||
setObjectValue: value
|
[theItem setValue: value
|
||||||
forTableColumn: tb
|
forKeyPath: keyPath];
|
||||||
byItem: item];
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ([_dataSource respondsToSelector:
|
||||||
|
@selector(outlineView:setObjectValue:forTableColumn:byItem:)])
|
||||||
|
{
|
||||||
|
id item = [self itemAtRow: index];
|
||||||
|
|
||||||
|
[_dataSource outlineView: self
|
||||||
|
setObjectValue: value
|
||||||
|
forTableColumn: tb
|
||||||
|
byItem: item];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue