You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Bill van Melle <bi...@gmail.com> on 2010/12/02 02:17:15 UTC

Why can't I nest a SplitPane inside a BoxPane?

I'm feeling stupid again.  In this example, which nests a SplitPane inside a
BoxPane, the SplitPane doesn't display at all, but I do see the other
element in the BoxPane.  If I elevate the SplitPane to be the child of
Border, getting rid of the BoxPane and its other child, it displays fine.
 What am I missing?

<my:TestWindow maximized="true"
  xmlns:bxml="http://pivot.apache.org/bxml"
  xmlns:my="com.fxpal.test"
  xmlns="org.apache.pivot.wtk">
  <Border styles="{color:10, thickness:5, cornerRadii:10}">
    <BoxPane bxml:id="paneMain" styles="{padding:4, verticalAlignment:'top',
fill:true}"
      orientation="vertical">
      <BoxPane styles="{padding:4, horizontalAlignment:'center',
backgroundColor:'yellow'}">
        <Label text="Header pane" styles="{horizontalAlignment:'center',
font:{size:20}}" />
      </BoxPane>
      <SplitPane bxml:id="paneSplit" orientation="vertical">
        <top>
          <Border styles="{backgroundColor:'pink'}">
            <Label text="top pane" />
          </Border>
        </top>
        <bottom>
          <Border styles="{backgroundColor:'green'}">
            <Label text="bottom pane" />
          </Border>
        </bottom>
      </SplitPane>
    </BoxPane>
  </Border>
</my:TestWindow>

Re: Why can't I nest a SplitPane inside a BoxPane?

Posted by Greg Brown <gk...@verizon.net>.
This is actually a common source of confusion. A SplitPane doesn't have a preferred size - you either need to give it one explicitly or put it in a container that will give it a size.
G

On Dec 1, 2010, at 8:17 PM, Bill van Melle wrote:

> I'm feeling stupid again.  In this example, which nests a SplitPane inside a BoxPane, the SplitPane doesn't display at all, but I do see the other element in the BoxPane.  If I elevate the SplitPane to be the child of Border, getting rid of the BoxPane and its other child, it displays fine.  What am I missing?
> 
> <my:TestWindow maximized="true" 
>   xmlns:bxml="http://pivot.apache.org/bxml" 
>   xmlns:my="com.fxpal.test"
>   xmlns="org.apache.pivot.wtk">
>   <Border styles="{color:10, thickness:5, cornerRadii:10}">
>     <BoxPane bxml:id="paneMain" styles="{padding:4, verticalAlignment:'top', fill:true}"
>       orientation="vertical">
>       <BoxPane styles="{padding:4, horizontalAlignment:'center', backgroundColor:'yellow'}">
>         <Label text="Header pane" styles="{horizontalAlignment:'center', font:{size:20}}" />
>       </BoxPane>
>       <SplitPane bxml:id="paneSplit" orientation="vertical">
>         <top>
>           <Border styles="{backgroundColor:'pink'}">
>             <Label text="top pane" />
>           </Border>
>         </top>
>         <bottom>
>           <Border styles="{backgroundColor:'green'}">
>             <Label text="bottom pane" />
>           </Border>
>         </bottom>
>       </SplitPane>
>     </BoxPane>
>   </Border>
> </my:TestWindow>