Re: Auto-resize scrolled window



Le 21 septembre 2015, Subsentient a écrit :
 On 09/21/15 20:33, Subsentient wrote:
> When I resize the window, I'm having difficulty finding a way to make a > scrolled window automatically resize with it. I can't use > gtk_widget_set_size_request(), because then I won't be able to shrink it > down again. > Working in C. How can I have a widget automatically resize to fill all > available space given by a window, and then be willing to shrink again > if the user tries to resize the window?
I've even tried putting it into a GtkAlignment with full expansion. It's in a vbox btw.

In my app the window has the following layout, and it resizes (expands and shrinks) nicely:

window (with default size)
 + hpaned
    + frame
    |  + scrolled_window (policies "automatic")
    |     + drawing_area (added with viewport; has size request)
    + vbox
       + frame
       |  + scrolled_window (policies "never" and "automatic")
       |     + text_view (with size request)
       + hbox
          + entry
          + button

This is Gtk 2. To insert the frame into the vbox, and the entry into the hbox, I invoke:
gtk_box_pack_start( ..., ..., TRUE, TRUE, 0);

To insert the frame into the hpaned:
gtk_paned_pack2( ..., ..., TRUE, FALSE);

For the vbox into the hpaned:
gtk_paned_pack1( ..., ..., FALSE, FALSE);

HTH

--
Lucas Levrel


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