On Aug 20, 2009, at 7:55 AM, Joshua Garnham wrote:
I am using an NSOutlineView
in my App so i downloaded Apples Photo Search Sample App which uses an
NSOutlineView. While using it I noticed that it gives the root/
header object
of the outline view a Gradient Background, so I looked through the
code
but I couldn't see what did it. Would someone mind looking through the
code and then telling me what code gave the root object a background?
Here's the link to the Photo Search Download Page -
http://developer.apple.com/Samplecode/PhotoSearch/index.html
Thanks!
This:
- (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item {
return [item isKindOfClass:[SearchQuery class]];
}
But also the full width cell part is important:
- (NSCell *)outlineView:(NSOutlineView *)outlineView
dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item {
// The "nil" tableColumn is an indicator for the "full width" row
if (tableColumn == nil) {
if ([item isKindOfClass:[SearchQuery class]]) {
return iGroupRowCell;
} else if ([item isKindOfClass:[SearchItem class]] && [item
metadataItem] == nil) {
// For failed items with no metdata, we also use the
group row cell
return iGroupRowCell;
}
}
return nil;
}
corbin
_______________________________________________
Cocoa-dev mailing list ([email protected])
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 [email protected]