Hi Alex,
Yes, it is the intended behavior, because the rule is that all
settings (shape, figure and interaction) get reset after a #nodes: or
#edges:from:to: command.
The reason is this.
If you add several nodes of the same type, in 99% of the cases you
will have them in one collection, and if you want them to behave the
same one #nodes: command and one set of settings is all you need. If
they are not in the same collection, then you can probably simply
construct a collection. If you want them to behave or appear
differently, then you want to have control over the settings for both
cases.
If you add several nodes of different types, then you want to have
several #nodes commands. However, because there are several types the
settings that work for one set of nodes do not work for the settings
of another type.
Let's change your example a bit:
| view |
view := ViewRenderer new.
view interaction popupText: [:e | (e + 1) printString].
view node: 1.
view node: 'a'.
view open
If you propagate the settings to the 'a' node, you will get an error
because String does not understand #+.
That is why we decided to have the settings reset after each command.
There are indeed a few cases when you will have to duplicate some of
your settings code, but the compromise is quite good.
Cheers,
Doru
On 1 Apr 2009, at 12:05, Alexandre Bergel wrote:
Dear All,
I was wondering what should be the correct behavior in Mondrian in
VW. Consider the following scripts:
| view |
view := ViewRenderer new.
view interaction popupText: [:e | 'first level'].
view node: 1.
view node: 2.
view open
the popup appears for the first node only. Is it really the intended
behavior? I would expect the interaction object to be shared between
nodes
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"It's not how it is, it is how we see it."