[Gtk-sharp-list] question about Gtk.TextView

Davy Brion davy.brion@pandora.be
Tue, 2 Sep 2003 20:45:10 +0000


Hey guys,

i feel stupid forasking this, but i'm completely new to Gtk# and it sure takes 
a while to get used to if you're used to System.Windows.Forms:

how can i make sure that a TextView widget doesn't 'grow' once the text inside 
contains more lines than the amount of lines that can be visible?  I just 
want a TextView control that resizes whenever it's container resizes (it does 
that), but i don't want it to resize once it has too many lines of text.  I 
want it to display a scrollbar and then scroll to the bottom once there are 
too many lines of text.

I created a class which inherits VBox, and this is how i create the textview:

public class CServerStatus : VBox
{
	private TextView m_txvTextView;
	private TextBuffer m_txbTextBuffer;
	...

	public CServerStatus() : base(false,0)
	{
		m_txvTextView = new TextView();
		m_txvTextView.Editable = false;
		m_txbTextBuffer = m_txvTextView.Buffer;
		...

		base.PackStart(m_txvTextView,true,true,0);
		base.PackStart(m_btnConnect,false,false,0);
		base.PackStart(m_btnDisconnect,false,false,0);
		...
	}
	...
}

can anyone tell me what i need to do to make sure the TextView doesn't grow 
once the text exceeds the visible range and to make it show scrollbars 
instead?

if this is the wrong place for asking these kind of questions, sorry but it's 
pretty hard to get started with Gtk# if you don't have any Gtk experience.

If anyone could point me to some (up to date) examples of Gtk# applications, 
or more documentation, i'd be very grateful :)

thx