mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
Add code to set selection indexes on the controller
This commit is contained in:
parent
c39095cd61
commit
c68c459584
2 changed files with 21 additions and 0 deletions
|
@ -147,6 +147,7 @@
|
|||
if (self == [NSArrayController class])
|
||||
{
|
||||
[self exposeBinding: NSContentArrayBinding];
|
||||
[self exposeBinding: NSSelectionIndexesBinding];
|
||||
[self setKeys: [NSArray arrayWithObjects: NSContentBinding, NSContentObjectBinding, nil]
|
||||
triggerChangeNotificationsForDependentKey: @"arrangedObjects"];
|
||||
}
|
||||
|
|
|
@ -6713,6 +6713,26 @@ For a more detailed explanation, -setSortDescriptors:. */
|
|||
|
||||
- (void) _postSelectionDidChangeNotification
|
||||
{
|
||||
NSTableColumn *tb = [_tableColumns objectAtIndex: 0];
|
||||
GSKeyValueBinding *theBinding;
|
||||
|
||||
theBinding = [GSKeyValueBinding getBinding: NSValueBinding
|
||||
forObject: tb];
|
||||
|
||||
// If there is a binding, send the indexes back
|
||||
if (theBinding != nil)
|
||||
{
|
||||
id observedObject = [theBinding observedObject];
|
||||
|
||||
// Set the selection indexes on the controller...
|
||||
theBinding = [GSKeyValueBinding getBinding: NSSelectionIndexesBinding
|
||||
forObject: observedObject];
|
||||
if (theBinding != nil)
|
||||
{
|
||||
[theBinding reverseSetValue: _selectedRows];
|
||||
}
|
||||
}
|
||||
|
||||
[nc postNotificationName: NSTableViewSelectionDidChangeNotification
|
||||
object: self];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue