view := RTView new.
el := (RTCompositeShape new
shape1: RTBox new;
shape2: RTLabel new)
elementOn: 'Element'.
view add: el.
view canvas addMenu: 'Color' callback: [ el shape shape1 color: Color red. el
update. view canvas signalUpdate ].
view open
The color of the box is changed but it does not have the good size anymore.
Roassal shapes have been designed to be factory of Trachel shapes. At the end, everything
boils down into trachel shapes, which are agnostic to your model.
If you want to change the color, you should directly talk to the trachel shape, as with:
=-=-=-==-=-=-==-=-=-==-=-=-=
view := RTView new.
el := (RTCompositeShape new
shape1: RTBox new;
shape2: RTLabel new)
elementOn: 'Element'.
view add: el.
view canvas addMenu: 'Color' callback: [ el trachelShape shape1 color: Color red.
view signalUpdate ].
view open
=-=-=-==-=-=-==-=-=-==-=-=-=
The second one is with one of the shape is a
RTCompositeShape itself
view := RTView new.
el := (RTHorizontalCompositeShape new
shape1: (RTCompositeShape new shape1: RTBox new; shape2: RTLabel new);
shape2: (RTEllipse new size: 10; color: Color blue))
elementOn: 'Element'.
view add: el.
view canvas addMenu: 'Color' callback: [ el shape shape2 color: Color red. el
update. view canvas signalUpdate ].
view open
Actually, this is a bug in Roassal2, and this is the same problem than in your previous
example.
You can easily bypass this bug by directly talking to the trachel shape.
-=-=-=-=-=-=-=-=-=
view := RTView new.
el := (RTHorizontalCompositeShape new
shape1: (RTCompositeShape new shape1: RTBox new; shape2: RTLabel new);
shape2: (RTEllipse new size: 10; color: Color blue))
elementOn: 'Element'.
view add: el.
view canvas addMenu: 'Color' callback: [ el trachelShape shape2 color: Color red.
view signalUpdate ].
view open
-=-=-=-=-=-=-=-=-=
Cheers,
Alexandre
Raise an error :
<subclassResponsibility-RTCompositeShape.png>
RTCompositeShape>>#updateFor:trachelShape: is missing
--
Cheers,
Leo Perard
University of Lille 1
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.