NSMatrix
A legacy interface for grouping radio buttons or other types of cells together.
Declaration
class NSMatrixOverview
NSMatrix uses flipped coordinates by default. The cells in an NSMatrix object are numbered by row and column, each starting with 0; for example, the top left NSCell would be at (0, 0), and the NSCell that’s second down and third across would be at (1, 2).
The NSMatrix class has the notion of a single selected cell, which is the cell that was most recently clicked or that was so designated by a selectCell(atRow:column:) or selectCell(withTag:) message. The selected cell is the cell chosen for action messages except for performClick(_:) (NSCell), which is assigned to the key cell. (The key cell is generally identical to the selected cell, but can be given click focus while leaving the selected cell unchanged.) If the user has selected multiple cells, the selected cell is the one lowest and furthest to the right in the matrix of cells.
Topics
Initializing an NSMatrix Object
init(frame:)init(frame:mode:cellClass:numberOfRows:numberOfColumns:)init(frame:mode:prototype:numberOfRows:numberOfColumns:)
Configuring the Matrix Object
Managing the Cell Class
Laying Out the Cells of the Matrix
addColumn()addColumn(with:)addRow()addRow(with:)cellFrame(atRow:column:)cellSizegetNumberOfRows(_:columns:)insertColumn(_:)insertColumn(_:with:)insertRow(_:)insertRow(_:with:)intercellSpacingmakeCell(atRow:column:)numberOfColumnsnumberOfRowsputCell(_:atRow:column:)removeColumn(_:)removeRow(_:)renewRows(_:columns:)sort(using:context:)sort(using:)
Auto Layout Sizing
Finding Matrix Coordinates
Managing Attributes of Individual Cells
Selecting and Deselecting Cells
selectCell(atRow:column:)selectCell(withTag:)selectAll(_:)keyCellsetSelectionFrom(_:to:anchor:highlight:)deselectAllCells()deselectSelectedCell()
Finding Cells
Modifying Graphics Attributes
Editing Text in Cells
selectText(_:)selectText(atRow:column:)textShouldBeginEditing(_:)textDidBeginEditing(_:)textDidChange(_:)textShouldEndEditing(_:)textDidEndEditing(_:)