Hi!
Just to share our latest feature.
We have implemented a simple mechanism in Roassal to prevent the environment to be
sluggish with many elements.
The class RTCache has the effect to remove the elements from a view, create a bitmap from
them, and add the bitmap to the view. Simple and effective.
Consider the following script:
-=-=—=-=-=—=-=-=—=-=-=—=-=-=—=
v := RTView new.
v @ RTDraggableView.
colors := ColorPalette qualitative colors: 8 scheme:'Set1'.
elements := (RTEllipse new color: [ :aValue | colors atRandom alpha: 0.01 ]; size:
#yourself) elementsOn: ((1 to: 500000) collect: [ :vv | 10 atRandom + 5 ]).
elements do: [ :e | e translateTo: 500 atRandom @ 500 atRandom ].
v addAll: elements.
RTCache new cacheView: v.
v
-=-=—=-=-=—=-=-=—=-=-=—=-=-=—=
Without the line "RTCache new cacheView: v.” Pharo would be completely unresponsive.
500 000 elements is quite a lot.
The drawback is that all interaction with the elements are lost. I have some idea on how
to add them back. We will work on this in future work.
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.