Re: setting size of scrolled window



<bobyetman home com> writes:

      I'm new to GTK programming, and I've come across something
that has me stumped.   I've got a gtk_list inside of a
gtk_scrolled_window, and I want the window to display 10 elements
of the list.   But I've yet to find a way to tell either the
gtk_list or the gtk_scrolled_window to display 10 elements.

      Also, when I resize the app, I don't want the list to
display more than 10 items.   So the bottom-line question is
how do I set and keep the size of the list?


Basically you need to guesstimate the pixel height of 10 elements and do
this:
 gtk_widget_set_usize (scrolled_window, -1, height)

And be sure the scrolled window is packed into a container such that
it doesn't receive more space than its size request (for vbox and
table, set the "fill" flag to false).

Havoc




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