change box orientation in runtime?



This is just a proposal.

Shouldn't the gtk_boxes have the capacity to change orientation between
horizontal and vertical in runtime?
I mean, it would be nice to have all logic of hboxes and vboxes inside
just the box widgets.
Just insert a:
gboolean orientation,
in the properties of boxes, and add the logic of hboxes and vboxes
inside it.

For example, if I want to change a hbox into a vertical fashion, I must
destroy the hbox, and then rebuild all the destroys widgets inside a new
vbox where the last hbox resided. (This is no good, indeed).
Another bad solution, is to create a hbox and a vbox, and fill both of
them with the same widgets (a duplicate of every widget for each box),
and them show the hbox and hide the vbox. To change orientation you just
hide the hbox and show the vbox or viceversa. (Bad solution).

The good solution:
Add the logic of hboxes and vboxes inside the boxes simply adding an
orientation property, and functions to change the property. E.g.:
gtk_box_set_orientation(GTK_BOX(box),GTK_HORIZONTAL)...

For not killing backwards compatibility, hboxes and vboxes should be
only subclasses of the general box, with orientation set to
GTK_HORIZONTAL or GTK_VERTICAL (respectively) by default.

How all this sound? Anybody interested in doing this?
I'm not very well qualified to change the code, but anyway I'll try it.
By the way, if one call gtk_box_set_orientation, what widget function
should I call to produce a change in the
orientation? gtk_widget_queque_resize or something?



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