Re: Flowing columned container



On Sat, 2004-05-01 at 16:23, James Henstridge wrote:
> Murray Cumming wrote:
> 
> >Actually, I would not like the widget to gain width as it loses height.
> >I would just like it to move some of its child widgets around. And if
> >there is not enough room for the child widgets then it should not allow
> >the height to be reduced any more.
> >
> >Does it still seem like the same thing?
> >  
> >
> Yes it does.  I guess I didn't quite explain it right :)  In your 
> example, the minimum required width of the widget increases as the 
> height changes.  The widget could have more width allocated to it, but 
> you want the minimum width to be dependent on the height.

I think I know what you mean now, though I had to try it to understand.

I implemented a container that 
a) has a fixed number of columns.
b) requests the optimum (minumum) height after trying every possible
sequential combination of widgets in the columns.
c) requests the width needed for that optimum column height.  

This works for me, because I don't mind too much that the number of
columns is fixed, so the container will request useless width for empty
columns when the height is increased, as you see in these screenshots of
a 2-column "FlowTable":
http://www.murrayc.com/misc/flowtable/
 
But I guess we'd like the container to request less width for itself
when it can fit everything into less columns, as here:
http://www.murrayc.com/misc/flowtable/more_height_3.png
(The width of the window is the minumum allowed by the container in all
those pictures)

But we only ask it once for the width and height that it needs, so it
can't know that it should request less width because you are about to
give it more height - it can only request space for one ideal
arrangement. Now "width-for-height geometry" means more to me.

> As an example, consider a container like you described holding twelve 
> equal sized children.  If you size the container such that it can fit 3 
> rows of children, then you want the minimum width to be enough to fit 4 
> children across.  We want to allow the user to reduce the height of the 
> container (to give a 2x6 or 1x12 configuration), so we can't use 3 rows 
> as the minimum height request -- it should be one row.
> 
> Similarly, we want to be able to make the container less wide if the 
> container grows in height so the minimum width request can't be 4 -- it 
> should be one column for the 12x1 configuration.
> 
> However we don't want GTK to resize the container to one row by one 
> column, which it currently could if the minimum size request was 1 row 
> by 1 column.  This is why the geometry handling would need some changes 
> to correctly handle the type of container you proposed.
> 
> James.
-- 
Murray Cumming
www.murrayc.com
murrayc murrayc com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]