Hi Jan,

Help me to understand what’s going on :-)

Here is a 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).

v := RTView new.

data := {{ 'hello' . 30 . 50 } . { 'World' . 20 . 70} }.
v addAll: (compo elementsOn: data).

RTHorizontalLineLayout new alignCenter; on: v elements.
v elements @ RTDraggable.
v
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

It produces the following:


Why do you want to call #update?

Alexandre

On Mar 19, 2015, at 6:22 PM, Jan B. <bliznjan@fit.cvut.cz> wrote:

Hello

I am trying to work with composite shapes, but I encountered a problem.
Let's say I need to create a circle... and in the center of it is another,
smaller, circle with label (but I need it to be centered according to both
label and smaller circle, that's why I decided to use composite shapes
instead of RTLabelled).
I am able to create it just fine, problem is when I call update on its
RTElement.  I'm not sure whether I am even supposed to do it, but I think I
should be.

I start with just the inner circle with label:

| composite view |
composite := (RTLabel new
text: 'label';
yourself)
+
(RTEllipse new
size: 10;
yourself).
composite horizontal.
element := composite element.
view := RTView new.
view
add: element;
open.
element update.

Before element update, it looks fine, but when I call update, composite
layout (horizontal) gets lost.

Let's say I can ignore this problem (which I can't), and I will try the same
thing with whole shape

| composite view subcomposite |
subcomposite := (RTLabel new
text: 'label';
yourself)
+
(RTEllipse new
size: 10;
yourself).
subcomposite horizontal.
composite := (RTEllipse new
size: 50;
color: Color transparent;
borderColor: Color black;
yourself) + subcomposite.
element := composite element.
view := RTView new.
view
add: element;
open.
element update

this time I get exception MessageNotUnderstood: TRCompositeShape>>text:on:

I will appreciate any help, either by fixing something if it is broken, or
explaining how to reach my goal the correct way.

Jan




--
View this message in context: http://forum.world.st/Roassal-2-updating-CompositeShape-tp4813359.html
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

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.