On 20 Apr 2013, at 22:04, dirac wrote:

> I'm building a stack of horizontal widgets, like that (I hope the ASCII
> art works):
> 
> +---Fl_tile-------------------+
> | +-------------------------+ |
> | | widget 0                | |
> | +-------------------------+ |
> | +-------------------------+ |
> | | widget 1                | |
> | +-------------------------+ |
> | +-------------------------+ |
> | | widget 2                | |
> | +-------------------------+ |
> |+----------------------------+
> 
> I would like to make each widget vertically resizable, so an Fl_tile
> seems a good choice for a container.

Though I suspect that initial reaction may be misleading...


> Unfortunately I've noticed that Fl_tile shrinks the other widgets: for
> example if I enlarge Widget 0 completely to the very bottom, "widget 1"
> and "widget 2" disappear, i.e. their height becomes zero.


Yup, the issue here is (I think) that Fl_Tile, like many container widgets, is 
striving to maintain a fixed outer dimension, so as "widget 1" grows, the other 
widgets in the container need to shrink...

I guess that what you want is a container widget that will grow/shrink as it's 
children grow/shrink.

And that's not quite the same thing as an Fl_Tile.

> 
> My question: is there a way to extend Fl_tile so that it shifts the
> other widgets below Widget 0, instead of shrink them? Possibly Fl_tile
> should also expand itself vertically to make room for the other widgets.

Yes, though Fl_Tile may be the wrong place to start. I'd probably just start 
form an Fl_Group then modify the resize behaviour to match the changing sizes 
of the groups children...

Hmm, now, I seem to recall that Jason Bryan's "FLU" widget extensions for fltk 
had something like that - they would be worth a look.

OK; his pages at OSC.edu appear to be down, but there's a mirror here that 
still seems to work:

http://src.gnu-darwin.org/ports/x11-toolkits/flu/work/FLU_2.14/ 


Maybe his "collapsible group" widget might give you some starting hints?




_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to