Thank you Alex !
On Thu, Jun 4, 2015 at 10:52 PM, Alexandre Bergel
<alexandre.bergel(a)me.com> wrote:
Hi Serge,
You are perfectly right to avoid fork in my opinion. I am convinced that threads are evil
language constructions.
I have just improved RTActiveAnimation. You can get inspiration from:
-=-=-=-=-=-=-=-=-=-=-=-=
| v anim |
v := RTView new.
anim := RTActiveAnimation new.
anim intervalInMilliseconds: 1000.
anim blockToExecute: [
| e |
e := (RTEllipse new size: 40 atRandom; color: (Color red alpha: 0.2)) element.
e translateTo: (500 atRandom @ 500 atRandom) - (250 @ 250).
v add: e.
].
anim inView: v.
^ v
-=-=-=-=-=-=-=-=-=-=-=-=
You need to update Roassal.
Let us know how it goes
Cheers,
Alexandre
On Jun 4, 2015, at 10:55 AM, Serge Stinckwich
<serge.stinckwich(a)gmail.com> wrote:
On Thu, Jun 4, 2015 at 3:48 PM, Johan Fabry <jfabry(a)dcc.uchile.cl> wrote:
What I would try is to take the code of the
callback block for the button and fork it in a new thread. Or have the button launch the
thread. e.g.:
b menu: ‘animate' background: Color red callback:[
[ |es|
aModel runStep.
v removeAllElements.
es := (RTBox new color: c; size: 25) elementsOn: aModel
theVegetationUnits.
v addAll: es.
RTGridLayout new
gapSize:0;
lineItemsCount: aModel spaceModel column;
on: v elements.
v signalUpdate.
] fork.
].
I have not tried this though, I’m just inventing on the fly … but I guess it should work
OK. Just don’t click the button more than once ;-)
I would like to avoid fork.
I try to use VIVA and do the following, but nothing happens:
|choosenModel aModel nbSteps |
choosenModel := ECEC.
nbSteps := 200.
aModel := choosenModel initialize;new.
aModel initSimulation.
v := RTView new.
b := RTMenuBuilder new view:v.
n := (RTMultiLinearColor new) colors: (ColorPalette sequential colors:
9 scheme: 'YlGnBu').
c := n
command: [:cells| (cells biomass)/10.0.].
timer := VITimer new.
timer repeat.
time := VIAnimatedValue new
evaluator:[:t|
|es|
aModel runStep.
v clean.
es := (RTBox new color: c; size: 25) elementsOn: aModel theVegetationUnits.
v addAll: es.
RTGridLayout new
gapSize:0;
lineItemsCount: aModel spaceModel column;
on: v elements.
v signalUpdate.
t
];
timer: timer;
yourself.
time start.
v addAnimation: (TRResetAllShapes new).
v
--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/
_______________________________________________
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
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev