Ah -- makes sense thanks.

I'm generating guis automatically from simple composable pieces (tangible values), so I guess I'll have to come up with some scheme for propagating stretchability upward and then implementing the deduced spec.  Each pieces might be stretchy or not stretchy in either direction (all four possibilities), and there are compositions in both directions (horizontal for pair types/guis and vertical for function types/guis).

   - Conal

On Wed, Feb 24, 2010 at 2:41 PM, Evan Martin <martine@danga.com> wrote:
The VBox's size (and all widget sizes, recursively) is controlled by
whatever contains it.  I'd look at the flags used when the VBox was
added to its parent, or whether the parent was constructed with the
homogeneous flag set.

On Wed, Feb 24, 2010 at 11:34 PM, Conal Elliott <conal@conal.net> wrote:
> Thanks again.
>
> Hm.  The new VBox I put my slider into is itself in another container, and
> when I enlarge the window, some of the additional vertical spacing goes to
> padding that VBox, rather than being devoted fully to other widgets.  Any
> ideas?   - Conal
>
> On Tue, Feb 23, 2010 at 3:23 PM, Evan Martin <martine@danga.com> wrote:
>>
>> Yep, exactly.
>>
>> On Tue, Feb 23, 2010 at 11:43 PM, Conal Elliott <conal@conal.net> wrote:
>> > Thanks for the tips, Evan.  Do you mean to say that if I pack a
>> > (horizontal)
>> > slider into a VBox, using PackNatural, the slider will then stretch
>> > horizontally and not vertically (allotting extra vertical space to other
>> > widgets)?
>> >
>> >    - Conal
>> >
>> > On Tue, Feb 23, 2010 at 2:32 PM, Evan Martin <martine@danga.com> wrote:
>> >>
>> >> On Tue, Feb 23, 2010 at 9:07 PM, Conal Elliott <conal@conal.net> wrote:
>> >> > I'm programmatically generating GUIs (not using Glade), and I want
>> >> > some
>> >> > widgets (e.g. sliders) to stretch only horizontally (on interactive
>> >> > window
>> >> > resize), while allowing others (e.g. graphics canvases) to stretch
>> >> > horizontally and vertically.  Is there some gtk2hs magic that will
>> >> > give
>> >> > me
>> >> > this effect?
>> >>
>> >> Widget size is determined by their containers.  One-cell containers
>> >> (aka "bins", which include top-level windows, scrolled views, etc.)
>> >> typically have their children fill them completely.  Otherwise if you
>> >> wrap a widget in an HBox you can control the horizontal expansion or a
>> >> VBox to control the vertical expansion.  (Or a Table to control both,
>> >> but that is almost never needed in my experience.)  See the Packing
>> >> param to boxPackStart.
>> >>
>> >> Maybe this link will work if you're on a system like mine:
>> >>
>> >>
>> >> file:///usr/share/doc/gtk2hs-doc/html/Graphics-UI-Gtk-Abstract-Box.html#t%3APacking
>> >
>> >
>
>