How can I wrap or scroll text inside a GtkLabel to keep the width?

2008-12-11 Thread Guenther Meyer
hi,

I have GtkLabels packed inside some vboxes or tables, the width of the box is 
determined by the size of some other elements (buttons, listviews, ...).
when the text inside the labels is changed, and this text is too long to fit, 
the box automatically resizes, which distorts the whole window layout and 
pushes some widgets off the screen.
so how can I fix the width of the GtkLabel (which I don't know at creation), 
and let the text automatically wrap or scroll, if it doesn't fit?


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: How can I wrap or scroll text inside a GtkLabel to keep the width?

2008-12-11 Thread Alexander Semenov

Guenther Meyer wrote:

hi,

I have GtkLabels packed inside some vboxes or tables, the width of the box is
determined by the size of some other elements (buttons, listviews, ...).
when the text inside the labels is changed, and this text is too long to fit,
the box automatically resizes, which distorts the whole window layout and
pushes some widgets off the screen.
so how can I fix the width of the GtkLabel (which I don't know at creation),
and let the text automatically wrap or scroll, if it doesn't fit?


   



___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Hi.

voidgtk_label_set_ellipsize (GtkLabel *label,
 
PangoEllipsizeMode mode);


Sets the mode used to ellipsize (add an ellipsis: ...) to the text if 
there is not enough space to render the entire string.


Regards.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How can I wrap or scroll text inside a GtkLabel to keep the width?

2008-12-11 Thread Michael Cronenworth

 Original Message 
Subject: How can I wrap or scroll text inside a GtkLabel to keep the width?
From: Guenther Meyer [EMAIL PROTECTED]
To: gtk-app-devel-list@gnome.org
Date: 12/11/2008 02:22 AM


hi,

I have GtkLabels packed inside some vboxes or tables, the width of the box is 
determined by the size of some other elements (buttons, listviews, ...).
when the text inside the labels is changed, and this text is too long to fit, 
the box automatically resizes, which distorts the whole window layout and 
pushes some widgets off the screen.
so how can I fix the width of the GtkLabel (which I don't know at creation), 
and let the text automatically wrap or scroll, if it doesn't fit?





gtk_label_set_line_wrap( GTK_LABEL( label ), TRUE );

However, for this to work you must set a maximum size on the label.

gtk_widget_set_size_request( GTK_WIDGET( label ), 100, -1 );

100 being 100 pixels wide. You will probably want to include an 
alignment and justify call so that the text always looks nice.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list