Re: GTK 3 support status
- From: Tristan Van Berkom <tvb gnome org>
- To: Costin Chirvasuta <costinc gmail com>
- Cc: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: Re: GTK 3 support status
- Date: Tue, 6 Dec 2011 16:46:59 +0900
On Tue, Dec 6, 2011 at 2:22 AM, Costin Chirvasuta <costinc gmail com> wrote:
I don't really understand what max-width-chars would be useful for.
The max-width-chars property is intended to limit the overall size request
of a label.
if max-width-chars is set, the label will not by default request a natural
width of 'max-width-chars'... but if the label's actual width is larger, then
the natural width request will be *limited* to a maximum of 'max-width-chars'.
And of course, using either 'width-chars' or 'max-width-chars' is only
legal if the label is ellipsizing or wrapping.
The usefulness of limiting the natural width request of a label becomes
more obvious when you try to, for instance fit a wrapping label beside
an ellipsizing label in the same GtkBox:
you don't want the wrapping label to compete for size after acquiring
a fixed natural width.
Can't you set a "natural" size for a widget instead of a "natural" max
gtk_widget_set_natural_size() has been suggested and is probably a good
addition to the api (for this, patches are most probably welcome...)
However, it might not always work as you would desire:
gtk_widget_set_size_request() can only logically set the minimum size, since
the GtkWidget api has no knowledge of the content to display, the
might require more size.
gtk_widget_set_natural_size_request() could hypothetically set a hard coded
natural size request which is going to always be *at least minimum size*.
char width? If I want to ellipsize it won't do me any good if
"iiii..." is the same as "mmmm...".
Using a width in terms of charachters up until now has always been more
practical than using pixel sizes.
Because the width-chars property will ultimately use:
Which will take into account the chosen font and resolution.
If you are setting 'width-chars', then your text is dynamic text which
you are uncertain if it will fit in the ui or not.
Instead of asking yourself the irrelevant question about the width
of an 'i' vs the width of an 'a', you should be asking yourself
"what does 50 pixels mean on this machine"... perhaps when
displayed on a huge LCD panel, 50 pixels is less than the width
of one character...
I can see there is gtk_set_size_request for setting minimum width,
gtk_window_set_default_size for setting maximum ("natural") width (if
I understand correctly) but for windows. What can I use to set the
maximum or "natural" size for a widget?
gtk_window_set_default_size() does not effect any size request, its
just supposed to set the default size of the GtkWindow when it initially
However if you do NOT call set_default_size() manually, GTK+ will
use the natural request as the default size.
] [Thread Prev