Layouts in bloc

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Layouts in bloc

abergel
Hi!

Consider this piece of code:
-=-=-=-=-=-=
space := BlSpace new.
space root layout: BlLinearLayout horizontal.

10 timesRepeat: [ 
| e |
e := (BlRectangle new extent: 20 @ 20) asElement.
e background: Color random.
space root addChild: e.
].

space root children withIndexDo: [ :e :index | e translateBy: (index * 30) @ 10 ]. 
space show
-=-=-=-=-=-=

It produces the following:

Apparently, the manual translation has no effect (which is okay, I am at the stage of understanding the semantics of Bloc).
If I do not specify a layout, the translation works. Is there a way to have the layout, and still be able to manually translate the elements? I have the impression that yes, but not with the layouts provided currently?

I have seen a demo of some roassal layouts in Bloc. Where are they? Can I play with them?

Cheers,
Alexandre

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.