• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I make a header row have a gradient background in my NSOutlineView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I make a header row have a gradient background in my NSOutlineView?


  • Subject: Re: How do I make a header row have a gradient background in my NSOutlineView?
  • From: Corbin Dunn <email@hidden>
  • Date: Thu, 20 Aug 2009 08:58:31 -0700


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@hidden)

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:
This email sent to email@hidden


References: 
 >How do I make a header row have a gradient background in my NSOutlineView? (From: Joshua Garnham <email@hidden>)

  • Prev by Date: Execution of Replaced Method Jumps back to top -- How??
  • Next by Date: Re: bound popup cell not letting me set it's value
  • Previous by thread: How do I make a header row have a gradient background in my NSOutlineView?
  • Next by thread: NSWindow and Spaces
  • Index(es):
    • Date
    • Thread