Re: [gtk-list] change box orientation in runtime?



Read inside:

> 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).
>

One thing that you can do is build a Glist of all the items in the box,
gtk_widget_ref() each one, make the new box, add all the widgets to it, and
then gtk_widget_unref()... That could be done in about 10 lines of code I
think...

> 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).
>

I second this motion. It would be very useful for several of my projects, and
might make some of the various gnome stuff a bit easier as well.

>
> 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?
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



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