On Nov 21, 2007 3:04 PM, Behdad Esfahbod wrote: > On Nov 20, 2007 10:07 PM, Matthias Clasen wrote: > > On Nov 20, 2007 8:45 PM, Behdad Esfahbod wrote: > > > > > a) Maximize number of children taking their natural size. > > > > I am not convinced this is always the best strategy. Doesn't this > > encourage starving > > one child in favour of the rest of the pack getting their natural size? > > Right. We can add another goal to avoid starvation: > > c) If child i takes its natural size and child j doesn't, child j > should have received at least as much gap as child i. > > The algorithm I sketched satisfies this too. Yeah, true. Alternatively: there shall not be both children who receive less than their natural width and children that receive more than their natural width. Anyway, I don't think that the example of "bunch of ellipsiizing labels" can be generalized to make the case that the hippo-style algorithm is always better than some linear distribution scheme. One thing that I have not seen mentioned in this discussion so far is the fact that it is ultimatively an implementation detail of the container how it distributes its allocation to its children. There is nothing prohibiting a linearly-distributing container and a hippo-style container from coexisting. Both can use the same extended layout interface. It would also be possible to make the distribution algorithm pluggable. Matthias _______________________________________________ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list