Contents

NSMatrix

A legacy interface for grouping radio buttons or other types of cells together.

Declaration

class NSMatrix

Overview

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

Configuring the Matrix Object

Managing the Cell Class

Laying Out the Cells of the Matrix

Auto Layout Sizing

Finding Matrix Coordinates

Managing Attributes of Individual Cells

Selecting and Deselecting Cells

Finding Cells

Modifying Graphics Attributes

Editing Text in Cells

Setting Tab Key Behavior

Managing the Delegate

Resizing the Matrix and Its Cells

Scrolling Cells in the Matrix

Displaying and Highlighting Cells

Managing and Sending Action Messages

Handling Event and Action Messages

Managing the Cursor

Constants

Instance Methods

See Also

Controls