Re: [gtkmm] A small doc question



Am Don, 2002-10-17 um 00.11 schrieb Paul Davis:
> >
> >However, you should generally try to avoid set_size_request() unless
> >it's absolutely necessary, since it won't allow the user to shrink the
> >widget below that size.  Having a proper container layout makes it
> >usually sufficient to call set_default_size() on the main window.
> 
> this simply isn't true. there are all kinds of cases where you need to
> specifically size the widget. a trivial example is a non-editable
> Gtk::Entry widget intended to display one of a list of strings. you
> cannot get the right effect (if the right effect is "a text widget
> which doesn't change its size when its contents change") without
> set_usize() or its gtkmm2 equivalent.

Note that I said "try to avoid" and "unless it's absolutely necessary". 
I can certainly imagine cases where it is necessary, and I used it
myself a few times too.

But with regards to your example:  I have a non-editable Gtk::Entry in
one of my apps as well and don't see the problem you described.  The
entry is a preview area and its text changes quite often.  Neither does
it shrink when the text is short, nor does it expand when the text
doesn't fit into the entry.

This could be a fix in GTK+ 2.0, but actually I've never seen the
behaviour you described.

--Daniel





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