Re: scrollable vbox



Opel Martin wrote:



Did you try it with a hbox to put the scrollable vbox and the textwidget
in it.
To add both widgets, use the following:

 box = gtk_hbox_new(FALSE, 5); /* hbox for scrollable and textwidget */
 gtk_box_pack_start(GTK_BOX(box), scrollable_vbox, FALSE, FALSE, 0);
 gtk_box_pack_start(GTK_BOX(box), text_widget, TRUE, TRUE, 0)

Yes, that's what I did.

vishnu pobox com wrote:

Do you want this?

     GtkRequisition req;
     gtk_widget_size_request (vbox, &req);
     g_object_set (vbox, "width-request", req.width, NULL);

No, I don't think so.
I want gtk to determine the minimum size for the vbox.
Without  scrolbar that works; with a vertical scrolbar it should also work for
the width, I would say.
I think the problem is that, using 'gtk_scrolled_window_new' both scrollbars are
potentially present, even if the horizontal scrollbar is made 'aways invisible'
with:
gtk_scrolled_window_set_policy (..,GTK_POLICY_NEVER,...)
which would explain why gtk refuses to determine and set the minimum width for
the vbox. (Is this a bug or a feature?)

With using gtk_vscrollbar_new instead of gtk_scrolled_window_new maybe this issue
is solved, but I can't find out how to connect gtk_vscrollbar_new to a vbox (or
frame).

Rob.






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