Re: gtktextarea w/wordwrap: how to shrink the width?



Josh N Pritikin was kind enough to reply to my email:

On Sat, Aug 09, 2003 at 06:12:50PM -0700, Jeffrey Evarts wrote:

My application contains a GtkTable which holds a GtkTextArea.
I have the wrap on the textarea set to wordwrap.


When I expand the window (via the windowmanager) all is well.
(The text layout gets called, and the words roll up from later
lines to earlier ones as there is room on the prior lines.)

But when I go to shrink the window (via the windowmanager) the
app "refuses" to shrink the textarea in such a way that lines
would be broken in new places. (It will shrink so long as I am
only removing whitespace from the end of the longest line)

Putting the textarea in a scrolled window "solved" the problem
by letting the main window shrink, but then text was off the
scrolled area to the right, rather than getting laid out again,
using more vertical space to make up for the lost horizontal
space.


Did you set the width-request property of the textview?

Width-request is for the initial size, yes? As specified in the
paragraph above, this is upon shrinking via the windowmanager,
after the object is already drawn. If I am misunderstanding,
please let me know.


The text area is a status window. I would like it to resize
along with the rest of the table on the horizontal axis,
laying out the text using more vertical space as needed,
then add a vertical scrollbar when it's too big to fit.
(Scrollbar part is easy using a scrolled window)

It seems like I see text windows like this in a fair number
of applications, but I can't figure out how people are
doing it.

I would very much appreciate ANY additional responses to this
question.

-Jeff Evarts




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