I think the layout strategy works like.

allocate just enough size for each widget in each bin. all spacer are
ignored during this stage.

arrange and pack all the bins

if there are empty space left in the top level window, the extra space will
be shared by those bins which contain spacer or widget with a size policy
that is greedy for space. if there are no such spacer or greedy widget,
then the extra space will be shared by all.

in your b1, the buttons are not greedy and there is no spacer inside the
bin, therefore this bin will not participate in sharing the extra space.

what you said:
But "s" should not affect how widgets outside the containing bin
are placed, other than changing the size of the bin.

is inapplicable to Qt layout manager.
 On Oct 22, 2014 5:02 AM, "Don Guinn" <[email protected]> wrote:

> The actions of the bin s are still vague to me as to how and when widgets
> stretch or not. As I understand, bin h and bin v create bins or rectangular
> boxes in which other widgets can be placed either horizontally or
> vertically. The "s" parameter can modify how widgets within a bin are
> placed. But "s" should not affect how widgets outside the containing bin
> are placed, other than changing the size of the bin. Below is a script
> which creates 6 forms. The top two show two forms with bins to be put into
> the forms below. Those in the right column contain an "s" and those on the
> left do not. The middle row places the bins horizontally and the bottom row
> vertically.
>
> The bottom right seems to work right as the "s" in the second bin does not
> affect how the widgets in the first bin act. The still stretch as expected.
> However the middle right form the enclosed bins seems to be ignored as the
> left 3 buttons stay to the left when stretched horizontally. Shouldn't the
> first two buttons stretch and the last two separate?
>
> Just to confuse me more I modified the "bin z" in form "b0" to "bin sz"
> (the first form) and then the form B0HS1 works properly.
>
>
> NB. wd 'reset;'  NB. Remove NB. for easy closing the forms
>
> b0=:0 : 0
> bin h;
> cc b00 button;cn B00;
> cc b01 button;cn B01;
> bin sz;
> )
>
> b1=:0 : 0
> bin h;
> cc b10 button;cn B10;
> cc b11 button;cn B11;
> bin z;
> )
>
> bs1=:0 : 0
> bin h;
> cc b10 button;cn B10;
> bin s0;
> cc b11 button;cn B11;
> bin z;
> )
>
> wd 'pc B0 closeok;pn B0;'
> wd b0
> wd 'pmove 0 0 _1 _1;'
> wd 'pshow;'
>
> wd 'pc BS1 closeok;pn BS1;'
> wd bs1
> wd 'pmove 600 0 _1 _1;'
> wd 'pshow;'
>
> wd 'pc B0H1 closeok; pn B0H1;'
> wd 'bin h;'
> wd b0
> wd b1
> wd 'bin z;'
> wd 'pmove 0 100 _1 _1;'
> wd 'pshow;'
>
> wd 'pc B0HS1 closeok; pn B0HS1;'
> wd 'bin h;'
> wd b0
> wd bs1
> wd 'bin z;'
> wd 'pmove 600 100 _1 _1;'
> wd 'pshow;'
>
> wd 'pc B0V1 closeok; pn BV1;'
> wd 'bin v;'
> wd b0
> wd b1
> wd 'bin z;'
> wd 'pmove 0 200 _1 _1;'
> wd 'pshow;'
>
> wd 'pc B0VS1 closeok; pn BVS1;'
> wd 'bin v;'
> wd b0
> wd bs1
> wd 'bin z;'
> wd 'pmove 600 200 _1 _1;'
> wd 'pshow;'
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to