[Pharo-dev] Using TreeModel>>selectAll

Benjamin Benjamin.VanRyseghem.Pharo at gmail.com
Sat Dec 7 04:33:12 EST 2013


roots := #(1 2 3) collect: [ :e | TreeNodeModel new content: e ; yourself ].

TreeModel new
 roots: roots;
 multiSelection: true;
 openWithSpec.

roots third 
	selected: true;
	takeHighlight

Ben

On 07 Dec 2013, at 05:44, Martin Dias <tinchodias at gmail.com> wrote:

> ouch! thanks Ben.
> 
> Another related question: is there any way of selecting an arbitrary
> item? I tried (among others) with:
> 
> TreeModel new
>  roots: #(1 2 3);
>  multiSelection: true;
>  openWithSpec;
>  selection: 3
> 
> without success.
> 
> Cheers,
> Martín
> 
> 
> 
> On Thu, Dec 5, 2013 at 4:17 PM, Benjamin
> <Benjamin.VanRyseghem.Pharo at gmail.com> wrote:
>> your tree here is single selection so it will not work
>> 
>> TreeModel new
>> roots: #(1 2 3);
>> multiSelection: true;
>> openWithSpec;
>> selectAll
>> 
>> Ben
>> 
>> On 05 Dec 2013, at 15:38, Martin Dias <tinchodias at gmail.com> wrote:
>> 
>> Hi,
>> 
>> I'm not sure how this method should be used. I tried in different
>> ways, for example:
>> 
>> TreeModel new
>>   roots: #(1 2 3);
>>   selectAll;
>>   openWithSpec
>> 
>> But always the items are unselected. Is it a bug? or I didn't find the
>> way to use it?
>> 
>> Thanks,
>> Martín
>> 
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131207/b8349709/attachment-0002.html>


More information about the Pharo-dev mailing list