After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 329646 - GtkLabel line-wrapping does not work when inheriting widget width from a GtkContainer
GtkLabel line-wrapping does not work when inheriting widget width from a GtkC...
Status: RESOLVED DUPLICATE of bug 101968
Product: gtk+
Classification: Platform
Component: Widget: Other
2.8.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-02-02 18:08 UTC by Jim Krehl
Modified: 2010-07-30 08:17 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
program to reproduce the bug (843 bytes, text/plain)
2006-02-02 18:10 UTC, Jim Krehl
Details

Description Jim Krehl 2006-02-02 18:08:18 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").
Comment 1 Jim Krehl 2006-02-02 18:10:08 UTC
Created attachment 58595 [details]
program to reproduce the bug

can be compiled with: gcc `pkg-config --cflags --libs` wrapping.c -o wrapping
Comment 2 Luc Pi 2006-04-30 21:06:45 UTC
Note that is you use a longer string, it will be wrapped... "at some point".
Comment 3 Luc Pi 2006-04-30 21:18:07 UTC
s/is/if/
Comment 4 Owen Taylor 2006-04-30 21:48:04 UTC

*** This bug has been marked as a duplicate of 101968 ***