NSMatrix setState and setSelectionFrom
NSMatrix setState and setSelectionFrom
- Subject: NSMatrix setState and setSelectionFrom
- From: email@hidden
- Date: Fri, 2 Jul 2010 13:44:02 -0600
while(index != NSNotFound)
{
for(i=0;i<count;i++)
{
BMatrixCell *bmxc = [cells objectAtIndex:i];
int cmp = bfn.GetFileName().CompareNoCase(bmxc-
>mBFilename.GetFileName());
if(cmp == 0)
{
[bmxc setState:NSOnState];
[_browserView getRow:&row column:&col ofCell:bmxc];
NSInteger pos = (row*cols)+col;
[_browserView setSelectionFrom:pos to:pos anchor:pos highlight:YES];
break;
}
}
}
There is more code above and below this snippet but the point is that
after executing with multiple bmxc cells that should be selected only
the last one found is selected.
BUT, if [bmxc setState:NSOnState]; is not called as in:
while(index != NSNotFound)
{ for(i=0;i<count;i++)
{
BMatrixCell *bmxc = [cells objectAtIndex:i];
int cmp = bfn.GetFileName().CompareNoCase(bmxc-
>mBFilename.GetFileName());
if(cmp == 0)
{
[_browserView getRow:&row column:&col ofCell:bmxc];
NSInteger pos = (row*cols)+col;
[_browserView setSelectionFrom:pos to:pos anchor:pos highlight:YES];
break;
}
}
}
then all expected to be selected cells are selected !
Seems like strange behavior to me. Comments please.
-koko
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden