Re: TextView Width



Juan Agüí wrote:


	i'm trying to set a default width in chars for a text view, making the
cursor jump to the next line when a user reaches that limit writing in
the buffer. Right now, my text view grows rigthwards indefinitely as
more text is added. How could i fix this?

Turn on word wrap.
Then set the width as you want to.
Automatically, new (inserted) text will
be displayed in lines fitting right in.

Of course, this depends on what font is chosen.

If you want a fixed character-per-line width,
turn off word wrap and connect a callback to the
buffer's changed signal. There you can count
the characters deleted or added and add newline
characters in case.

I can also imagine that a scrolling window
causes the problem as it allows the textview
to grow instead of forcing the text to be cut...

Greetings
--
Mathias Nudge Hartwig
http://www.trans-japan.de/mathias




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