Re: TextView Width
- From: Mathias Nudge Hartwig <big_chief gmx de>
- To: Gtk-List <gtk-list gnome org>
- Subject: Re: TextView Width
- Date: Mon, 14 Oct 2002 16:57:14 +0200
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...
Mathias Nudge Hartwig
] [Thread Prev