Getting/Setting "reasonable" default size for a widget



How can I set some "reasonable" default size for a widget without
hindering resizing?

I have stumbled across this on many occasions, the nastiest is
a TreeView widget within a ScrolledWindow, particularly if the
number of lines/columns:

Without any size requests and with the scrolling policy set to
automatic, The TreeView will get ~ 20x20 Pixels.
When I set the size with set_size_request, the window may be
larger than needed, but can't be resized to a smaller size anymore;

What I would really like to have is an initial size for the treeview,
that is large enough to show all the data without scrolling if possible,
up to some given maximum size.

The only way I can see would be to manually do all the size calculations
and then set the size with "gtk_window_set_default_size", which would be
pretty grotesque, because the treeview already "knows" what size it needs:
When I set the scrolling policy to "never", everything would get the "right"
size, provided the data is small enough
(if not, I end up with a window several square miles in size ;-)

Any suggestions?

Regards,
                       Peter




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