• 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: Color entire table view row
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Color entire table view row


  • Subject: Re: Color entire table view row
  • From: Matt Massicotte <email@hidden>
  • Date: Thu, 4 Apr 2002 21:46:24 -0500

Finally!

A question that *I* actually know the answer to! I'm happy to report that I have implemented this myself quite effectively. I'm sure that it's not the best way to do it, so maybe some of the more experienced guys can give us both a hand :)

What I did was subclass NSTableColumn and change the columns in IB to my subclass. The actual subclass simply keeps an array of cells (instead of one single data cell) and overrides the methods that interact with the data cell.

In order to ensure that my column has the right number of cells, I adjust the number of cells every time my datasource's numberOfRowsInTableView method is called.

Now, you can set the text color of the cells to your heart's content.

This works rather well for me (although I have noticed that if you have multiple columns, and you only change one to your subclass, other rows get colorized and I'm not sure why)

So, I hope this points you in the right direction
Matt Massicotte
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Color entire table view row
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: Double click time
  • Next by Date: Re: Toplevel Objects in NIB files
  • Previous by thread: Re: Color entire table view row
  • Next by thread: Re: Color entire table view row
  • Index(es):
    • Date
    • Thread