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.h…
Sent from the Moose mailing list archive at
Nabble.com.