Hi Fabian,
On Mon, 9 Mar 2009, Fabian Jakobs wrote:
> Hi Fritz,
>> until very recently I had been somewhat confused about flex. Just for my
>> (hopefully better) understanding:
>>
>> Is flex really a property of the layout, or isn't it rather a "property"
>> of the placement of the widget into the container? If it was a property
>> of the layout, wouldn't it then apply to the placement of all widgets
>> inside this container (automagically) and wouldn't it then have to be set
>> with something like container.setFlex()?
>
> Flex is a per widget layout property, which is used by some layouts to
> determine how the widget is stretched. This is how it works: First the
> layout manager tries to place all widget with their preferred size. If
> there is still space remaining the flex factor determines how much of this
> space is allocated to each widget. The flex factors are relative values.
> If one widget has a flex value of 1 and another a flex value of 2, the
> second will receive twice as much from the remaining space. Shrinking
> works similar only that the flex values are inverted so that a widget with
> a larger flex values shrinks by a smaller amount. Note that even with flex
> values in place a widget will never grow beyond its max- and min-sizes.
thanks for the explanation, I think I can follow. One thing that confused me
was that flex can (must?) be set in the add call:
container.add(widget, {flex : 1});
I had interpreted this as a parameter to the "add-process".
Cheers,
Fritz
--
Oetiker+Partner AG tel: +41 62 775 9903 (direct)
Fritz Zaucker +41 62 775 9900 (switch board)
Aarweg 15 +41 79 675 0630 (mobile)
CH-4600 Olten fax: +41 62 775 9905
Schweiz web: www.oetiker.ch
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel