开发者

Nesting controls inside NSTableView rows

开发者 https://www.devze.com 2022-12-10 16:39 出处:网络
Is there a way to nest complex views - in particular an NSTokenView 开发者_运维技巧- inside each row of an NSTableView or NSOutlineView?The quick answer is yes.

Is there a way to nest complex views - in particular an NSTokenView 开发者_运维技巧- inside each row of an NSTableView or NSOutlineView?


The quick answer is yes.

Cocoa's user interface elements are implemented as a combination of two parts: a control (a complete subclass of NSView) and a cell (which handles the actual drawing and keyboard/mouse interaction). See Control and Cell Programming Topics for all of the dirty details.

In NSTableView and NSOutlineView, you can specify the cell class that gets used for each NSTableColumn (or even for each individual element, if you want to go that far). You can use NSButtonCell, NSTextFieldCell, and even NSTokenFieldCell.

The documentation on setDataCell: has more of the details.

0

精彩评论

暂无评论...
验证码 换一张
取 消