NSTableView and row selection
NSTableView and row selection
- Subject: NSTableView and row selection
- From: Julien Palmas <email@hidden>
- Date: Thu, 31 Mar 2005 11:30:48 +0900
I am trying to achieve a certain behavior for my NSTableView, but I have some difficulties.
To illustrate what I want, let me give an example.
Imagine that my table view displays cars.
The car class contains the name of the car, and its color.
Let's say I have 3 red cars in my list
car A, car C, and car E.
when I clic on car A, I want all the red cars in the table view to get selected as well.
If I am not mistaken, I should only use a NSIndexSet to set the selection. This is not my tricky part.
So now, I have all the red cars selected. And the user clics on car C (another red car). I don't want the selection to change, obviously. At the beginning, I though that would be easy : just look at the rowIndex the user wants to select and see if it belongs to the already selected IndexSet.
BUT, it looks like I can't get the clicked index !!!! I wanted to use the NSTableView delegate method
<x-tad-bigger>- (BOOL)tableView:(NSTableView *)</x-tad-bigger>aTableView<x-tad-bigger> shouldSelectRow:(int)</x-tad-bigger>rowIndex
but if you clic on an index that is already selected, this method doesn't get called !!
Then how on earth do I know the desired index ??
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden