Sure.

view := RTView new.

container := (RTHorizontalCompositeShape new
shape1: RTBox new;
shape2: RTLabel new)
elementOn: 'Container'.
els := (RTBox new size: 9; color: Color red) elementsOn: (1 to: 16).
container @ RTDraggable.

RTNest new layout: RTGridLayout; on: container nest: els.
view add: container; addAll: els.
view open

I tried to "cheat" with the order of the calls. I nested the els just with the box and then I created a composite shape with + but no success.

view := RTView new.

container := RTBox new elementOn: 'Container'.
els := (RTBox new size: 9; color: Color red) elementsOn: (1 to: 16).
RTNest new layout: RTGridLayout; on: container nest: els.
container + RTLabel.
container @ RTDraggable.

view add: container; addAll: els.
view open


On Mon, Apr 28, 2014 at 12:09 PM, Alexandre Bergel <alexandre.bergel@me.com> wrote:
Leo, can you provide an example of what was not working?

Alexandre

Le 28-04-2014 à 5:26, Leo Perard <leo.perard@gmail.com> a écrit :

Great excatly the kind of thing I expected.

I'm agree with Tudor, the nested element on a CompositeElement are really not great now. I maked some tests last weeks but no one was working.


On Sun, Apr 27, 2014 at 9:59 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi Alex,

This starts to look good.

The next thing is to specify where nested children go :). For example, I would want to be able to specify that the nested children should be in the blue rectangle. For this, we would probably need something in the direction of a ChildrenShape :). Also, the other challenge is to not let the RTNest make the decision of where to place the children.

What do you say?

Doru


On Sun, Apr 27, 2014 at 9:37 PM, Alexandre Bergel <alexandre.bergel@me.com> wrote:
Hi!

I’ve worked a bit on the composition. 
So far, we have three ways to compose shapes:

1 - RTCompositeShape. This is the composition that is used with +

-=-=-=-=-=-=-=-=-=-=
| v s1 s2 e |
v := RTView new.
s1 := RTBox new size: #yourself; color: Color blue.
s2 := RTEllipse new size: [ :value | value / 2 ]; color: Color red.
e := (RTCompositeShape with: s1 with: s2) elementOn: 50.
v add: e.
v
-=-=-=-=-=-=-=-=-=-=
<Screen Shot 2014-04-27 at 4.30.40 PM.png>

2 - RTHorizontalCompositeShape
Here is the effect of replacing RTCompositeShape by RTHorizontalCompositeShape in the previous example
<Screen Shot 2014-04-27 at 4.33.32 PM.png>

3 - RTVerticalCompositeShape
<Screen Shot 2014-04-27 at 4.33.52 PM.png>

All the shapes composed with RTCompositeShape have the same size. This is useful for example if you do: (RTBox new + RTLabel) elementOn: ‘Hello World’. You typically want the label and the box have the same size. When you want to line up shapes, I guess you do not care of having all the shapes of the same size.

This new behavior for horizontal and vertical should address what you need Leo.

The nice thing, in my opinion, is that we should be able to have any kind of strategy, for example, a grid of shapes. This is really a matter of small programming. 

Let me know if this is what you expect. Just update Roassal for this.

Cheers,
Alexandre



On Apr 25, 2014, at 5:55 AM, Leo Perard <leo.perard@gmail.com> wrote:

On Thu, Apr 24, 2014 at 10:00 PM, Alexandre Bergel <alexandre.bergel@me.com> wrote:
How can I reproduce this bug? What do you do exactly?
With this example you can reproduce it easily :

view := RTView new.
box := RTBox new color: Color green.
label := RTLabel new.
el := (RTCompositeShape new shape1: box; shape2: label).
el :=  (RTHorizontalCompositeShape new shape1: el; shape2: (RTEllipse new color: Color red)) elementOn: 'Hello World'.
view add: el.

view addMenu: 'Color' callback: [ el shape shape2 color: Color blue. el update. view signalUpdate ].

view open 

And even if I don't have a composite shape composed with another composite shape, the update is not good.
-- 
Leo Perard
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

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




_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--
Leo Perard
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--
Leo Perard