• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSMatrix setState and setSelectionFrom
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Bypass Network System Preferences for DNS lookup
  • Next by Date: Re: Capturing output from another task with elevated privilages
  • Previous by thread: Re: force rendering of views off screen
  • Next by thread: Calling javascript from Cocoa 'facelessly'
  • Index(es):
    • Date
    • Thread