Relative sizes apply to the amount of space available after all fixed
sizes have been taken into account. If there is only one component,
and it specifies a width of "1*", that component will be allocated
100% of the available space. If another component also specifies "1*",
each one will get 1/2 the available space. If the other component
specifies "2*", component 1 will get 1/3 and component 2 will get 2/3.
We could have allowed the user to specify a percentage value, but the
current approach avoids the issue of how to handle values that add up
to more than 100.
However, we didn't envision a use case for specifying a fractional
value. What exactly are you trying to do? Perhaps you could use the
new Filler component to meet your needs? For example, you could do this:
<TablePane>
<columns>
<TablePane.Column width="1*"/>
<TablePane.Column width="1*"/>
</columns>
<rows>
<TablePane.Row>
<Label text="50%"/>
<TablePane.Filler/> <!-- gets the other 50% -->
</TablePane.Row>
</rows>
</TablePane>
Here, the label gets 50%, as does the filler component, which
basically acts as an empty cell.
On Aug 6, 2009, at 5:06 PM, Scott Lanham wrote:
Hi,
The stock tracker example shows 1* having a relative size of 100%.
What is the
form of this argument used to get a relative size of less than 100%?
Thanks,
Scott.