A small script to display some elements.
|mainNode view title childNodes|
view := ROView new.
mainNode := (ROElement spriteOn: 'A Test Node') + ROBorder.
childNodes := (ROElement spritesOn: (1 to: 10)).
childNodes do: [:each | each + ROBorder].
mainNode addAll: (ROGridLayout on: childNodes).
view add: (ROVerticalLineLayout on: (mainNode)).
view open
Now, I would like to construct my ROGrid layout such that items per line are 3. However, there is no method in ROGridLayout that allows setting the line item count AND returns a collection of ROElements. So, I may propose the following code to be added on ROGridLayout (class-side):
on: aCollection withLineItemsCount: aBlock
| myLayout |
myLayout := self new gapSize: 5; lineItemsCount: aBlock.
myLayout applyOn: aCollection.
^ aCollection
let me know if it makes sense.
regards,
Usman