Re: NSMatrix - Selecting multiple cells in code
Re: NSMatrix - Selecting multiple cells in code
- Subject: Re: NSMatrix - Selecting multiple cells in code
- From: "Jason R. Bell" <email@hidden>
- Date: Mon, 25 Feb 2002 21:02:33 -0500
For the benefit of those searching the archives, I've solved my problem of
selecting multiple matrix (list mode) cells in code. Given a three cell
matrix in list mode, the following will select the first and third cell:
[matrix setSelectionFrom:0 to:0 anchor:0 highlight:YES];
[matrix setSelectionFrom:2 to:2 anchor:2 highlight:YES];
I still think the docs are anything but clear on the use of the anchor
parameter.
- Jason Bell
>
>
On Sunday, February 24, 2002, at 08:27 AM, Jason R. Bell wrote:
>
>
> I thought this would be an easy one but it has been over two days with
>
> no luck. I have an NSMatrix of button cells in list mode. When running,
>
> it is possible for the user to select cells "finder style" (click to select
>
> one, drag select or shift-click for ranges, and command-click for multiple
>
> individual cells) and it works fine. However, I want to select multiple
>
> cells in code. This has to be possible and should be simple but all of
>
> the selectCell methods unselect the previously selected cell and
>
> setSelectionFrom:to:anchor:highlight looks like another option but I
>
> can't see how it can be used to select something other than a continuous
>
> range.
>
>
>
> Here is the simplest possible case: NSMatrix of buttons in list mode
>
> with three cells. How do you select the first and third in code?
>
>
>
> This question appears to have been asked a long time ago on the list but
>
> with no correct response. Please help.
>
>
>
> Jason Bell
>
> _______________________________________________
>
> 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.
_______________________________________________
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.