You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Edgar Merino <do...@gmail.com> on 2011/06/04 08:16:25 UTC

Fill window

Hello, I've been trying to get my components to fill the whole window of 
my application but I haven't been able to, I've got a simple BoxPane 
with styles="{fill: true}" and this is the content of my window, I'd 
expect all the components inside the BoxPane should fill the whole 
available space. The structure is as follows:

<Window maximized="true"
     xmlns="org.apache.pivot.wtk">

<content>
<BoxPane styles="{fill: true"}>
<StackPane>
<ImageView image="@background.png"  styles="{fill: true, 
preserveAspectRatio: false}"/>
</StackPane>
</BoxPane>
</content>

</Window>

What can I do to make the contents of BoxPane fill the entire wndow?


Thanks in advance.
Edgar Merino

Re: Fill window

Posted by Edgar Merino <do...@gmail.com>.
Thank you Roger, your explanation was quite helpful. I had already tried 
using TabPanes for this, but was not working. After reading your 
explanation I tried to solve the issue and I did it, the problem was 
that the ImageView was inside a BoxPane, which was causing the ImageView 
not to expand to fill the window.

Again, thanks for your help!
Edgar Merino

El 04/06/11 16:47, Roger Whitcomb escribió:
> Hi Edgar,
> Have you looked at the ComponentExplorer demo?  It is very useful for 
> seeing some of these things.  It is located at: 
> http://pivot.apache.org/demos/component-explorer.html
> But, in short, a BoxPane, generally speaking, takes on the dimensions 
> of its children.  It is usually a container used to line up components 
> along a vertical or horizontal axis.  But, if you set the "fill" style 
> to "true", then it will try to fill up the opposite direction of its 
> axis.  So, a horizontal BoxPane will fill the entire space vertically, 
> and a vertical one will fill the entire space horizontally.  If you 
> want to fill in both dimensions, then either a GridPane with one cell 
> or a TablePane with widths and/or heights of "1*" will fill up the 
> entire space in either or both dimensions.  You can see you to use 
> these from the Tutorial pages starting here: 
> http://pivot.apache.org/tutorials/
>
> Hope that helps,
> ~Roger Whitcomb
>
> On Jun 4, 2011, at 5:12 PM, Edgar Merino wrote:
>
>> I just want my components (ImageView or any other) to fill the entire 
>> window, what am I missing here?
>>
>>
>> El 04/06/11 08:03, Edvin Syse escribió:
>>> Den 04.06.2011 08:16, skrev Edgar Merino:
>>>> Hello, I've been trying to get my components to fill the whole 
>>>> window of
>>>> my application but I haven't been able to, I've got a simple BoxPane
>>>
>>>> <ImageView image="@background.png" styles="{fill: true,
>>>> preserveAspectRatio: false}"/>
>>>
>>> Do you actually want background.png to strech to fill the entire Window?
>>>
>>> -- Edvin
>>
>>
>

Re: Fill window

Posted by Roger Whitcomb <Ro...@rbwhitcomb.com>.
Hi Edgar,
	Have you looked at the ComponentExplorer demo?  It is very useful for seeing some of these things.  It is located at: http://pivot.apache.org/demos/component-explorer.html
	But, in short, a BoxPane, generally speaking, takes on the dimensions of its children.  It is usually a container used to line up components along a vertical or horizontal axis.  But, if you set the "fill" style to "true", then it will try to fill up the opposite direction of its axis.  So, a horizontal BoxPane will fill the entire space vertically, and a vertical one will fill the entire space horizontally.  If you want to fill in both dimensions, then either a GridPane with one cell or a TablePane with widths and/or heights of "1*" will fill up the entire space in either or both dimensions.  You can see you to use these from the Tutorial pages starting here:  http://pivot.apache.org/tutorials/

Hope that helps,
~Roger Whitcomb

On Jun 4, 2011, at 5:12 PM, Edgar Merino wrote:

> I just want my components (ImageView or any other) to fill the entire window, what am I missing here?
> 
> 
> El 04/06/11 08:03, Edvin Syse escribió:
>> Den 04.06.2011 08:16, skrev Edgar Merino:
>>> Hello, I've been trying to get my components to fill the whole window of
>>> my application but I haven't been able to, I've got a simple BoxPane
>> 
>>> <ImageView image="@background.png" styles="{fill: true,
>>> preserveAspectRatio: false}"/>
>> 
>> Do you actually want background.png to strech to fill the entire Window?
>> 
>> -- Edvin
> 
> 


Re: Fill window

Posted by Edgar Merino <do...@gmail.com>.
I just want my components (ImageView or any other) to fill the entire 
window, what am I missing here?


El 04/06/11 08:03, Edvin Syse escribió:
> Den 04.06.2011 08:16, skrev Edgar Merino:
>> Hello, I've been trying to get my components to fill the whole window of
>> my application but I haven't been able to, I've got a simple BoxPane
>
>> <ImageView image="@background.png" styles="{fill: true,
>> preserveAspectRatio: false}"/>
>
> Do you actually want background.png to strech to fill the entire Window?
>
> -- Edvin


Re: Fill window

Posted by Edvin Syse <ed...@sysedata.no>.
Den 04.06.2011 08:16, skrev Edgar Merino:
> Hello, I've been trying to get my components to fill the whole window of
> my application but I haven't been able to, I've got a simple BoxPane

> <ImageView image="@background.png" styles="{fill: true,
> preserveAspectRatio: false}"/>

Do you actually want background.png to strech to fill the entire Window?

-- Edvin