MorphTreeMorph

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

MorphTreeMorph

Benjamin Van Ryseghem (Pharo)
Hi guys,

I had a little problem about MorphTreeMorph>>#setSelectedNodeItemList:

setSelectedNodeItemList: aNodeItemCollection
        | keptSelectedMorphList |
        self selectedMorphList removeAll.
        "Don't work directly with selectedMorphList because for very long  
list, #drawOn: is time consuming"
        keptSelectedMorphList  := selectedMorphList.
        selectedMorphList := #().
        keptSelectedMorphList  addAll: (self nodeMorphsWithAllNodeItems:  
aNodeItemCollection).
-------
I break here
-------
        selectedMorphList := keptSelectedMorphList.
        lastClickedMorph ifNil: [lastClickedMorph :=  selectedMorphList  
ifEmpty: [nil] ifNotEmpty: [selectedMorphList last]].
        self selectionChanged.


Due to the break, selectedMorphList is an empty array, and when I try  
to resend the message, removeAll from the start is not understood ...

Is there a reason why selectedMorphList is set as an empty array ?


Cheers,

Ben

Reply | Threaded
Open this post in threaded view
|

Re: MorphTreeMorph

Alain Plantec-4
Le 29/11/2010 11:24, Benjamin a écrit :

> Hi guys,
>
> I had a little problem about MorphTreeMorph>>#setSelectedNodeItemList:
>
> setSelectedNodeItemList: aNodeItemCollection
>     | keptSelectedMorphList |
>     self selectedMorphList removeAll.
>     "Don't work directly with selectedMorphList because for very long
> list, #drawOn: is time consuming"
>     keptSelectedMorphList  := selectedMorphList.
>     selectedMorphList := #().
>     keptSelectedMorphList  addAll: (self nodeMorphsWithAllNodeItems:
> aNodeItemCollection).
> -------
> I break here
> -------
>     selectedMorphList := keptSelectedMorphList.
>     lastClickedMorph ifNil: [lastClickedMorph :=  selectedMorphList
> ifEmpty: [nil] ifNotEmpty: [selectedMorphList last]].
>     self selectionChanged.
>
>
> Due to the break, selectedMorphList is an empty array, and when I try
> to resend the message, removeAll from the start is not understood ...
>
> Is there a reason why selectedMorphList is set as an empty array ?
I don't think so.
This assignment should be removed.
Cheers
Alain

> Cheers,
>
> Ben
>
>