Re: Extended Layout Summary

On Nov 20, 2007 11:55 AM, Ryan Lortie <desrt desrt ca> wrote:
> On Tue, 2007-11-20 at 17:13 +0100, Mathias Hasselmann wrote:
> > For supporting your feature there should be a separate call:
> >
> >       void (*get_supported_sizes) (GtkOrientation   orientation,
> >                                      GtkRequisition **sizes,
> >                                    guint           *n_sizes);
> A couple of points:
> 1.  Don't be hasty abut this.
> Consider having a bunch (m) of multiple-natural-sized widgets (each with
> "n" different natural sizes) within a single container.  This means that
> there are n^m possible "natural sizes" for the container.  You get to a
> point where the natural sizes given would almost form a continuum across
> all possible values.  It gets worse when you consider that the value "n"
> itself is possibly exponential (2 to the power of number of possible
> groupings).
> What would this extra information do for you?  What I mean: how would
> your updated decision-making algorithm for boxes look?

While you are right that blindly combining all natural sizes of the
children leads to the
exponential explosion in natural sizes of the container, that would be
a pretty stupid strategy for a container to implement. It should
certainly be aggressive in pruning the total space
by ruling out nonsensical combinations like picking the smallest sizes
for all-but-one children, and the largest size for the last child.
Allowing such combinations would also lead to
noncontinuous resizing behaviour, or at least to counterintuitive
resizing behaviour where growing the container may shrink some of the
children, while others grow.

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