Yes, this is how the Qt layout manager works. I believe the layout manager looks for controls that normally stretch or are explicitly stated to stretch, and allows them and their enclosing layout to stretch where possible.
Usually there is only one control that needs to stretch, e.g. a grid or multi-line edit. You would want that control and its layout to dominate while the remaining controls remain at their default size. BTW, J just uses the Qt layout manager. If you created the form directly in Qt, it would have exactly the same behaviour. On Tue, Oct 21, 2014 at 3:21 PM, Don Guinn <[email protected]> wrote: > I am still confused. The two bins ordered horizontally should stretch as > there is no "s" for the enclosing bin. Then the widgets in each bin should > either stretch or not depending on the "s" within each bin. But when there > is an "s" in the second bin the first bin does not stretch. The "s" in the > enclosed second bin is affecting the enclosing bin and how other bins in it > act. > > On Tue, Oct 21, 2014 at 4:01 PM, chris burke <[email protected]> wrote: > > > The enclosing "bin h" makes the two inside bins line up horizontally. > > > > By default, buttons will only stretch out horizontally. So their > behaviour > > in bins depends on whether the bins are horizontal or vertical. If the > > enclosing "bin h" is changed to "bin v", then the behaviour again seems > > correct. > > > > On Tue, Oct 21, 2014 at 2:53 PM, Don Guinn <[email protected]> wrote: > > > > > It's as if the the enclosing "bin h" is ignored. With the enclosing > "bin > > v" > > > the first two buttons stretch and the last two separate. Shouldn't the > > same > > > thing happen with the enclosing "bin h"? > > > > > > After I sent the message I realized that the change I mentioned didn't > > show > > > anything. Please ignore that. > > > > > > On Tue, Oct 21, 2014 at 3:40 PM, chris burke <[email protected]> > > wrote: > > > > > > > This looks OK to me. The example is given below. > > > > > > > > The form has a horizontal bin, containing two horizontal bins. > > > > > > > > 1. In the original form, stretching occurs only between B10 and B11, > > and > > > > indeed this is the only place in the form where there is a stretch > > > > parameter. > > > > > > > > 2. In the modified form (with the first bin z replaced by bin sz), > > there > > > > are now two stretch parameters. The first stretch parameter allows > the > > > > first horizontal bin to stretch, so in the modified form there are > two > > > > stretches: > > > > > > > > * both horizontal bins stretch to grab half the horizontal space > each > > > > > > > > * in the first bin, the new space appears at the end of the bin > > > > > > > > * in the second bin, the new space appears in the middle of the bin > > > > > > > > wd 0 : 0 > > > > pc B0HS1 closeok; pn B0HS1; > > > > bin h; > > > > bin h; > > > > cc b00 button;cn B00; > > > > cc b01 button;cn B01; > > > > bin z; > > > > bin h; > > > > cc b10 button;cn B10; > > > > bin s0; > > > > cc b11 button;cn B11; > > > > bin z; > > > > bin z; > > > > pmove 600 100 _1 _1; > > > > pshow; > > > > ) > > > > > > > > > > > > On Tue, Oct 21, 2014 at 2:01 PM, 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 > > > > > > > ---------------------------------------------------------------------- > > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
