Misunderstanding re -[NSMatrix selectedCells]??
Misunderstanding re -[NSMatrix selectedCells]??
- Subject: Misunderstanding re -[NSMatrix selectedCells]??
- From: Michael Norris <email@hidden>
- Date: Fri, 15 Aug 2003 14:00:45 +1200
Hi there
I seem to be labouring under a misunderstanding about what exactly the
-[NSMatrix selectedCells] method does.
Reading the docs, I figure it ought to return an array of all the
"highlighted" cells of an NSMatrix.
However, in my current app I have an NSMatrix of checkboxes, and I want
to get an array of those NSButtonCells that are checked. I would have
thought that [theMatrix selectedCells] would give me this, particularly
given that [theMatrix selectAll] and [theMatrix deselectAll] check and
uncheck all the boxes respectively.
What it returns, however, is an array containing a single NSButtonCell
which is the last checkbox that was clicked on by the user, no matter
whether it to check or uncheck the checkbox.
I'm guessing that the problem must be that for checkboxes, being
checked and being selected are different things. A cell is selected if
the user clicks on it, whether or not they click on it to turn it off
or turn it on. Is that a fair assumption? How then can I easily
retrieve an array of checked checkboxes in my NSMatrix?
-----------------------
Michael Norris
Composer/Programmer
8 Bidwill St
Mt Cook
Wellington 6002
NEW ZEALAND
-----------------------
Ph: +64 4 803 3644
Web:
http://mnorris.wellington.net.nz
Stroma:
http://stroma.wellington.net.nz
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.