Reputation: 15510
I would like a NSCell in an OutlineView to display the number of the children the row it's has. Here's what I mean:
(source: sourceforge.net)
What's on the right, but for all rows.
How would I go about finding out, first, which row the NSCell is and then from there getting the number of children that row has.
Upvotes: 1
Views: 195
Reputation: 243156
PXSourceList does this.
edit re: the comment about displaying the number of children in the badge
If you use the excellent PXSourceList, then you'll simply implement a single delegate method:
- (NSInteger)sourceList:(PXSourceList*)aSourceList badgeValueForItem:(id)item;
Most likely, you'll implement this as:
- (NSInteger)sourceList:(PXSourceList*)aSourceList badgeValueForItem:(id)item {
return [self sourceList:aSourceList numberOfChildrenOfItem:item];
}
Upvotes: 2