Re: How to make GtkLabel fills like GtkTextView?



Can anyone tell me what is the case to use 'GtkTextView' instead of 'GtkLabel'
to display a text with several sentences(< 100 words) in not editable way?

Maybe for `beauty' looks, the author want the text wrapped as it's parent container width that GtkLabel can't 
do.

How to make GtkLabel fill the entire range, just like what GtkTextView did?

As the doc says: You can't not make the label wrap at its parent container's width, because GTK+ widgets 
conceptually can't make their requisition depend on the parent container's size. GtkLabel only wrap-able at a 
given specific position.

                   Ardhan


--- dancefire gmail com wrote:

From: Tao Wang <dancefire gmail com>
To: gtk-app-devel-list gnome org
Subject: How to make GtkLabel fills like GtkTextView?
Date: Thu, 10 Jun 2010 13:08:25 +1000

Hi,

Some of the code I'm working on is using 'GtkTextView' to display text,
which is just few sentences, rather than GtkLabel. I don't know why, Can
anyone tell me what is the case to use 'GtkTextView' instead of 'GtkLabel'
to display a text with several sentences(< 100 words) in not editable way?

I tried to replace those GtkTextView with GtkLabel, which set wrap to
'word', the result is different. Here is the screenshot:
http://i48.tinypic.com/n1os9f.png . I put the GtkTextView and GtkLabel to
seperate GtkScrolledWindow, which disabled both scrollbar. The above is the
GtkTextView, it expend to entire GtkScrolledWindow, and the below is the
GtkLabel, it's only in a small range in the middle of the GtkScrolledWindow.
How to make GtkLabel fill the entire range, just like what GtkTextView did?
Thanks.


-- 
Regards

Tao Wang
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




_____________________________________________________________
Listen to KNAC, Hit the Home page and Tune In Live! ---> http://www.knac.com



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