a question on ROGrid layout

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

a question on ROGrid layout

Usman Bhatti
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
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: a question on ROGrid layout

abergel
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
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

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



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: a question on ROGrid layout

abergel
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
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

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



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev