GNOME Bugzilla – Bug 329646
GtkLabel line-wrapping does not work when inheriting widget width from a GtkContainer
Last modified: 2010-07-30 08:17:58 UTC
Please describe the problem: If I call gtk_widget_set_size_request on a GtkLabel directly -- setting it to narrower than the single-line string requires -- line wrap works. However, if I call gtk_widget_set_size_request on the GtkLabel's container the label is clipped, not wrapped. Steps to reproduce: Attached is a sample program which illustrates this. There is a GtkVBox, with width set to 130, that contains two identical GtkLabels. One label, however, has it's size explicitly set to 130 as well, while the other label does not. The height is not set and allowed to be "natural" in all cases. Actual results: The label that has it's size explicitly set does wrap, while the other label is clipped. Expected results: I would expect both labels to be wrapped since they're both rendering at a 130 pixel width. Does this happen every time? Yes. Other information: I'm not sure if this is a duplicate of bug #322580 ("GtkLabel doesn't wrap when width_chars is set").
Created attachment 58595 [details] program to reproduce the bug can be compiled with: gcc `pkg-config --cflags --libs` wrapping.c -o wrapping
Note that is you use a longer string, it will be wrapped... "at some point".
s/is/if/
*** This bug has been marked as a duplicate of 101968 ***