pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill van Melle <bill.van.me...@gmail.com>
Subject Re: The patchwork that is Pivot layout
Date Fri, 18 Mar 2011 22:08:22 GMT
>
> So you've just demonstrated the recursive aspect of my question.  If I set
> a preferred size on a component, and stick that component inside a Border,
> the latter now also has a notion of preferred size.  If the Border is then
> placed inside a TablePane cell, why should the TablePane cause it to ignore
> that size?
>
> It doesn't. TablePane also tries to respect the preferred size of its
> cells. But when a TablePane isn't given its preferred size, it can't give
> its children their preferred sizes, either. So it resizes the cells based on
> the cell width and row height properties.
>

I'm clearly misunderstanding something here.   Try running this toy example:

<Window title="Preferred size example" maximized="true"
  xmlns="org.apache.pivot.wtk">
  <TablePane>
    <columns>
      <TablePane.Column width="100" />
      <TablePane.Column width="1*" />
    </columns>
    <TablePane.Row height="80">
      <Border preferredWidth="50" preferredHeight="20"
styles="{backgroundColor:'blue'}"/>
      <Label styles="{wrapText:true}"
        text="Why is the blue box to my left 100px wide instead of its
requested 50px, and 80px high instead of 20?" />
    </TablePane.Row>
  </TablePane>
</Window>

Why does TablePane override the preferred size of the Border element?

Mime
View raw message