0

Is it possible to set an NSMatrix as the cell of a NSTableColumn?. If possible, how should I do it?

Thanks in advance.

mikywan
  • 1,495
  • 1
  • 19
  • 38

1 Answers1

0

First, you can't do this easily because table columns expect an NSCell to use as their data cell (so they can draw the column's contents at a given row). NSMatrix is a similar control that uses a prototype cell to draw many times.

Second, there was a tutorial out there (can't find it any more) that showed how to use NSViews as NSTableView rows. Hint: if you have access to the latest pre-release API, you will have a pleasant surprise.

Third, "multiple columns of text on a cell" in a table sounds like a perfect job for ... multiple text columns.

What exactly are you really trying to do? The more specific you get, the better answers / advice we can give. :-)

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135
  • I was trying to do this: http://stackoverflow.com/questions/6576180/nscell-with-divisions. I have done it by subclassing NSCell and setting multiple NSTextFieldCell on it. – mikywan Jul 07 '11 at 12:59
  • I'd argue this kind of complexity begs for an NSCollectionView / NSCollectionViewItem instead of an NSTableView/NSOutlineView. – Joshua Nozzi Jul 07 '11 at 14:23