• 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: NSOutlineView and background color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView and background color


  • Subject: Re: NSOutlineView and background color
  • From: Stefan Arentz <email@hidden>
  • Date: Mon, 4 Jun 2001 14:00:04 +0200

On Sun, Jun 03, 2001 at 10:42:44PM -0700, Steve Gehrman wrote:
> I would like to make my NSOutlineView look just like iTunes with
> alternating blue and white rows.
>
> I can't seem to find a way to do this. Please help!

- (void) tableView: (NSTableView*) aTableView willDisplayCell: (id) aCell
forTableColumn: (NSTableColumn*) aTableColumn row: (int) aRowIndex
{
if ((aRowIndex % 2) == 0) {
[aCell setDrawsBackground: YES];
[aCell setBackgroundColor: [NSColor colorWithCalibratedRed: 0.90 green: 0.90 blue: 0.80 alpha: 1.0]];
} else {
[aCell setDrawsBackground: NO];
[aCell setBackgroundColor: [NSColor whiteColor]];
}
}

Please note that this can be optimized by keeping the color around. Do you have
good code to draw the divider lines? The grid doesn't seem to work here :-/

Stefan


References: 
 >NSOutlineView and background color (From: Steve Gehrman <email@hidden>)

  • Prev by Date: Re: HFS volume name and its device file
  • Next by Date: Re: cocoa-dev digest, Vol 1 #96 - 11 msgs
  • Previous by thread: NSOutlineView and background color
  • Next by thread: Re: NSOutlineView and background color
  • Index(es):
    • Date
    • Thread