Mod to hbox/vbox



I'd like to be able to weight the amount of space given to
children of an hbox or vbox.

I can't seem to find an easy way to say "I have three
expandable children in this hbox, please make sure the
middle one gets 3/5 of the space, and the left and right
children get 1/5 each". If there is a way to do this
already, please email me and skip the rest of this document.

Right now, when in non-homogeneous mode, the hbox traverses
the children, counting the number of visible ones which are
expandable. Then it shares out the horizontal space equally
between them, and makes another pass to allocate space for
each expandable child.

I would add an integer element "shares" to the _GtkBoxChild
structure, and count the total shares owned by all children
that are invisible and expandable, and on the second pass,
I just do one additional multiply to find the width.

I'd also add a function call "gtk_box_add_weighted" which
would add the child and assign the shares. A shares value
of one (1) would be assigned in the gtk_box_add and various
*pack* functions, to maintain current functionality.

Well, any thoughts?

-Jeff
-- 
-Jeff Evarts
--jdeassoc@earthlink.net
---http://www.ecst.csuchico.edu/~amarth/



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