Re: NSMatrix selections
Re: NSMatrix selections
- Subject: Re: NSMatrix selections
- From: David P Henderson <email@hidden>
- Date: Fri, 8 Jun 2001 18:55:30 -0400
On Friday, June 8, 2001, at 03:52 , Tom Waters wrote:
I've been digging deeper into NSBrowser and have my own NSMatrix
subclass in use to support drag and drop, etc.
I note that NSMatrix also doesn't have a method for making
discontinuous selections, even though the user can make them through
the interface.
NSMatrix adds setSelectionFrom:to:anchor:highlight: which allows for
multiple selection, but I'm assuming that selectCellAtRow:column
selects only a single cell, as that is the behavior that NSBrowser
shows.
I must be missing something obvious.
If you are trying to find out which cells the user has selected, use
-selectedCells which returns an array of the selected cells; then, work
with the cells in the array. Otherwise send -selectCellAtRow:column: or
-selectCellWithTag: for each cell you want selected.
While I'm displaying my ignorance, could someone explain to me the
philosophical difference between a cell being selected, highlighted and
having it's state set?
[snip]
In my cells, I draw the selection highlight if isHighlighted is true,
but what is state used for? and where is the notion of selection
stored if one can set the highlighted state separate from the selected
state?
Highlighting deals with the physical appearence of the cell. State is
the on/off value of the cell. Selection affects both highlighting and
state. Note, not all types of cells have stats and not all cells with
states highlight to reflect their state.
Dave
--
Chaos Assembly Werks
"Suburbia is where the developer bulldozes out the trees, then names the
streets after them."
- Bill Vaughn