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
Very good point. I will commit as soon as squeaksource.com is up again. I will probably switch to ss3 on some point...
Alexandre
On Jun 28, 2012, at 2:17 PM, Usman Bhatti wrote:
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 _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
1.46 : Fixed Issue 85: ROGridLayout and lineCounter. Thanks Usman!
Cheers, Alexandre
On Jun 30, 2012, at 1:29 AM, Alexandre Bergel wrote:
Very good point. I will commit as soon as squeaksource.com is up again. I will probably switch to ss3 on some point...
Alexandre
On Jun 28, 2012, at 2:17 PM, Usman Bhatti wrote:
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 _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev