Hi Leo,
Sorry to reply so late.
Your script does exactly what it is supposed to do. Maybe part of the shape semantic is not clear.
Consider this part of the script:
e on: TRMouseClick do: [ :event | e shape color: Color random. e update. els atRandom update. view signalUpdate ]
You click on an element e, which means you change the shape of the element. You update the element itself, it therefore changes its color. But with "els atRandom update” you also update another element. Since the shape is shared by all the elements, the behavior is indeed correct.
A shape is shared with all the objects. What is not shared are Trachel shapes.
You have the following relations:
shape := RTBox new size: 10. e1 := shape elementOn: 'hello'. e2 := shape elementOn: 'world'.
self assert: e1 shape == e2 shape.
self assert: e1 shape ~~ e1 trachelShape. self assert: (e1 shape isKindOf: RTBox). self assert: (e1 trachelShape isKindOf: TRBoxShape).
self assert: e1 trachelShape ~~ e2 trachelShape.
Let me know if something is not clear. I have written this in the class comment of RTShape.
Cheers, Alexandre