Hi Peter!
Basically I want to have either:
a) option to execute behavior when element is added to view --- this is basically direct
counterpart to TRRemovedCallback.
So I could do things like...
element addCallback: (TRAddedCallback: [ :shape | "add dependent elements or
whatever" ]).
Sure, easy. I have just committed this. Update Trachel and you can do (this is a test I
wrote):
-=-=-=-=-=-=-=-=-=
testAddingCallback
| t c s canvas |
t := OrderedCollection new.
c := TRAddedCallback new.
c block: [ :aShape | t add: aShape ].
self assert: t isEmpty.
s := TRBoxShape new size: 30.
s addCallback: c.
self assert: t isEmpty.
canvas := TRCanvas new.
canvas addShape: s.
self deny: t isEmpty.
self assert: t size equals: 1.
self assert: t anyOne equals: s
-=-=-=-=-=-=-=-=-=
b) have RTInteractions be lazily initialized --- only
after the element has been added to the view.
(or both)
This is a bit more problematic. I am not sure about it.
The idea is to have more clearly resolvable
interactions like RTLabelled, which currently requires for the element to be already in
the view.
I'm not sure if the second option will be entirely feasible, because many of the
interactions are stateless and require immediate evaluation... but that could be resolved
with some flags or different subclassing or something...
Is it possible for you? Is this something you want in Roassal?
Are these lazy interactions something you need just for the added callback? Or is it
something you need for other needs?
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.