Actually no. Updating the visualization should be done by manipulating trachel shapes.
Roassal shapes are good to create elements. Once an element has been created, modifying its shape should not result in an update of the visualization. Because there are some case where one do not want this.
Modifying a visualization should be done by modifying trachel shapes. Or building appropriate Roassal interactions.
I agree with you, this is not an easy things to grasp.
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> On Mar 20, 2015, at 7:35 PM, Jan B.
bliznjan@fit.cvut.cz wrote:
>
> Yes, it fully works even in our app this way. Thank you.
> Just to understand it correctly, is this avoiding of using update by getting
> trachelShape just workaround of a problem with composite shapes, right?
> Should update on composite shapes work in perfect world, and I could use it
> without any possible problem, yes?
>
> Jan
>
>
> abergel wrote
>> Hi Jan,
>>
>> Composite shapes could be a nasty beast. This is a part of Roassal for
>> which I am not even sure of which semantics if should have. So, we may
>> end-up in some corner, as you have explained.
>> However, we are luck here: this is a easy problem to solve.
>>
>> The modification you wish to have, which is changing the label has to be
>> done directly on the trachel shape and _not_ the roassal shape.
>> Consider this slightly modified version of the script:
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> compo := RTCompositeShape new.
>> compo add: (RTEllipse new size: [ :tupple | tupple third ]; color: Color
>> lightBlue).
>> compo add: (RTEllipse new size: [ :tupple | tupple second ]; color: Color
>> blue).
>> compo add: (RTLabel new text: [ :tupple | tupple first ]; color: Color
>> red).
>> "ADDED LINE to demonstrate it does not keep this layout: " compo vertical.
>>
>> v := RTView new.
>>
>> data := {{ 'hello' . 30 . 50 } . { 'World' . 20 . 70} }.
>> v addAll: (compo elementsOn: data).
>>
>> RTHorizontalLineLayout new alignCenter; on: v elements.
>> v elements @ RTDraggable.
>>
>> "ADDED LINE where I change labels text:" v elements do: [ :elem | |label|
>> label := elem trachelShape shapes third. label text: 'LABEL'. ].
>>
>> v
>> -=-=-=-=-=-=-=-=-=-=-=-=
>>
>> And just to make my email more entertaining, here is the screenshot:
>>
>>
>> Alexandre
>
>
>
>
>
> --
> View this message in context:
http://forum.world.st/Roassal-2-updating-CompositeShape-tp4813359p4813737.ht...
> Sent from the Moose mailing list archive at Nabble.com.
> _______________________________________________
> Moose-dev mailing list
> Moose-dev@iam.unibe.ch
>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev