mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 06:51:44 +00:00
Implement setSelectionIndexPaths:
This commit is contained in:
parent
110facc6f6
commit
b7156def8f
1 changed files with 21 additions and 0 deletions
|
@ -437,6 +437,27 @@ static NSString *placeholderItem = nil;
|
|||
{
|
||||
ASSIGN(_selectionIndexPaths, indexPaths);
|
||||
}
|
||||
|
||||
// First unselect all of the items
|
||||
FOR_IN(id, item, _visibleItems)
|
||||
{
|
||||
if ([item respondsToSelector: @selector(setSelected:)])
|
||||
{
|
||||
[item setSelected: NO];
|
||||
}
|
||||
}
|
||||
END_FOR_IN(indexPaths);
|
||||
|
||||
// Now select all that are selected
|
||||
FOR_IN(NSIndexPath*, p, indexPaths)
|
||||
{
|
||||
id item = [self itemAtIndexPath: p];
|
||||
if ([item respondsToSelector: @selector(setSelected:)])
|
||||
{
|
||||
[item setSelected: YES];
|
||||
}
|
||||
}
|
||||
END_FOR_IN(indexPaths);
|
||||
}
|
||||
|
||||
- (NSIndexSet *) selectionIndexes
|
||||
|
|
Loading…
Reference in a new issue