GtkLabel can shrink but not grow?
- From: Gus Koppel <gtk spamkiller bytechase cx>
- To: <gtk-app-devel-list gnome org>
- Subject: GtkLabel can shrink but not grow?
- Date: Sun, 24 Aug 2003 11:43:49 +0200
I have a problem with a GtkLabel with wordwrap turned on. It's on one
side of a GtkHPaned, so it's width is supposed to be adjustable by the
user at runtime. The GtkLabel is embedded in a GtkScrolledWindow +
GtkViewport to handle situations when the label becomes too narrow to
show all of its text. I expected the label to reformat its text
according to its width changing. That doesn't happen automatically.
Okay, then I connected a handler for size_allocate-events of the label's
parent GtkViewport. (I couldn't find another suitable signal.) Handler
gets invoked properly and I am able to determine the changing widths via
viewport_widget->allocation.width. Then I adjust the width of the
GtkLabel via gtk_widget_set_size_request (). The label seems to change
its width then indeed.
The problem: when the Gtklabel gets narrower its text gets properly
reformatted. However, when the label gets wider the text stays narrowly
wrapped, it doesn't expand again. So basically I am able to shrink a
GtkLabel but not expand it again. What can I do to achieve the latter?
I've been looking for a function to explicitly enforce recalculation of
wordwrapping but the only candidates I found seem to be static functions
in GtkLabel.c. What can I do to make the wordwrapping text of a grown
label occupy its entire area?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]