Programmatically selects a range of cells.
SDK
- macOS 10.0+
Framework
- App
Kit
Declaration
Parameters
startPos
The position of the cell that marks where the user would have pressed the mouse button.
endPos
The position of the cell that marks where the user would have released the mouse button.
anchorPos
The position of the cell to treat as the last cell the user would have selected. To simulate Shift-dragging (continuous selection)
anchor
should be thePos end
used in the last method call. To simulate Command-dragging (discontinuous selection),Pos anchor
should be the same as this method call’sPos start
.Pos lit
true
if cells selected by this method should be highlighted.
Discussion
start
, end
, and anchor
are cell positions, counting from 0 at the upper left cell of the receiver, in row order. For example, the third cell in the top row would be number 2.
To simulate dragging without a modifier key, deselecting anything that was selected before, call deselect
before calling this method.