• 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: row bg color in NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: row bg color in NSOutlineView


  • Subject: Re: row bg color in NSOutlineView
  • From: "John C. Randolph" <email@hidden>
  • Date: Fri, 21 Dec 2001 04:22:20 -0800

On Friday, December 21, 2001, at 04:03 AM, Raphael Sebbe wrote:

Hello all,

What is the best way of setting the background color in an outline view, per row, based on item kind ? I tried some custom data cells (NSTextFieldCell) but its background color is ignored (or changed to white just before drawing ?). Attributed string is not what I want because it won't cover the entire row (just the text).

Also, if that can help, I use a custom NSTableColumn subclass.

To save storage, NSTableView reuses cells to draw multiple items.

The docs say:

- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex

Informs the delegate that aTableView will display the cell at rowIndex in aTableColumn using aCell. The delegate can modify the display attributes of aCell to alter the appearance of the cell. Because aCell is reused for every row in aTableColumn, the delegate must set the display attributes both when drawing special cells and when drawing normal cells.

-jcr

[Objc retain];


  • Follow-Ups:
    • Re: row bg color in NSOutlineView
      • From: jgo <email@hidden>
    • Re: row bg color in NSOutlineView
      • From: Raphael Sebbe <email@hidden>
References: 
 >row bg color in NSOutlineView (From: Raphael Sebbe <email@hidden>)

  • Prev by Date: Re: Is an just allocated object allways set to autorelease? What about my subclasses?
  • Next by Date: Re: Is an just allocated object allways set to autorelease? What about my subclasses?
  • Previous by thread: row bg color in NSOutlineView
  • Next by thread: Re: row bg color in NSOutlineView
  • Index(es):
    • Date
    • Thread