Re: GTK 3 support status



Hi Tristan,

This makes a bit more sense now.

On 12/05/2011 09:27 AM, Tristan Van Berkom wrote:
On Mon, Dec 5, 2011 at 11:18 PM, John Lindgren<john lindgren aol com>  wrote:
It looks to me as though there are 3 separate problems contributing here:

1. GtkLabel does not take into account gtk_widget_set_size_request() when
reporting its "natural" size:
https://bugzilla.gnome.org/show_bug.cgi?id=662043
Not a bug.

No widgets should ever peek at the explicit user set size request to
implement the size negotiation vfuncs.

Those are handled in GtkWidgetClass.adjust_size_request() base class
implementation.

So using gtk_widget_set_size_request() as a way to set the width of a label is no longer valid in GTK+ 3. Fair enough.

2. Nor does it take into account gtk_label_set_width_chars():
https://bugzilla.gnome.org/show_bug.cgi?id=665560
It does, width-chars, as always, only effects the minimum size, not
the natural size.

I get it now. You set the minimum width of a label with gtk_label_set_width_chars() and the natural/default width with gtk_label_set_max_width_chars().

The documentation is very misleading; actually, the entire documentation for gtk_label_set_width_chars() consists of the sentence fragment, "Sets the desired width in characters of label to n_chars." I do not think that most people would make the connection between "desired width" and "minimum width".

Likewise, the documentation for gtk_label_set_max_width_chars() is, "Sets the desired maximum width in characters of label to n_chars." I do not think that most people would make the connection between "desired maximum width" and "natural/default width".

3. GtkWindow ignores gtk_window_set_default_size() and instead goes to its
"natural" size if the window is not resizable:
https://bugzilla.gnome.org/show_bug.cgi?id=665596
As I mentioned in the previous mail, I believe this has *always* been the case,
GtkWindow always shrinks down to minimum size (or now in GTK+3 'natural size')

This is how you get the shrinking dialogs when closing the expander in them
(for non-resizable windows).

However, it could be considered a bug, one would expect GtkWindow to make
an attempt to honor a user set default size for a non-resizable window.

Perhaps it's even a regression from GTK+2, not so sure.

I think it should be considered a bug; however, I do not care so much about gtk_window_set_default_size() now that I can set the size of the label directly. Using gtk_window_set_default_size(), you might recall, was your suggestion from an earlier mail:
So I'm attaching my version of your test case, actually except for
the label being somehow severely broken here, your code works
nicely... I added a line that says gtk_window_set_default_size()
and I think that will fix all your problems.

Thanks for your help. I will close #662043 and #665560 but add a comment that the documentation is wrong and needs to be updated.

-- John



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