简体   繁体   English

NSTableColumn 上的 NSMatrix

[英]NSMatrix on NSTableColumn

Is it possible to set an NSMatrix as the cell of a NSTableColumn?.是否可以将 NSMatrix 设置为 NSTableColumn 的单元格? If possible, how should I do it?如果可能的话,我应该怎么做?

Thanks in advance.提前致谢。

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).首先,您不能轻易做到这一点,因为表格列期望 NSCell 用作它们的数据单元格(因此它们可以在给定行绘制列的内容)。 NSMatrix is a similar control that uses a prototype cell to draw many times. NSMatrix 是一个类似的控件,它使用一个原型单元进行多次绘制。

Second, there was a tutorial out there (can't find it any more) that showed how to use NSViews as NSTableView rows.其次,有一个教程(再也找不到了)展示了如何将 NSViews 用作 NSTableView 行。 Hint: if you have access to the latest pre-release API, you will have a pleasant surprise.提示:如果您可以访问最新的预发布 API,您将有一个惊喜。

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.您获得的越具体,我们可以提供的答案/建议就越好。 :-) :-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM