[Gtk-sharp-list] Gtk# TextView and Scrolling Text
count.cb at gmx.net
Thu Jun 5 04:16:10 EDT 2008
> Hi there,
> I'm fighting with TextView widget. Everything is fine except that when I
> load text to it and move cursor in it - the coursor can go out of view
> (TextView doesn't scroll). I tried many examples with using TextIter and
> TextMark and ScrollToMark function, bu it simply doesn't work.
> Can anyone please tell me what am I doing wrong?
> Best regards,
You have to add your TextView to a ScrolledWindow widget and then add this
ScrolledWindow to the window/dialog you want the TextView to be displayed
Below is a small test program which demostrates a srolling TextView.
public static void Main (string args)
Gtk.Window win = new TestWindow();
class TestWindow : Gtk.Window
public TestWindow() : base(Gtk.WindowType.Toplevel)
this.DeleteEvent += this.OnDeleteEvent;
ScrolledWindow scrolledWindow = new ScrolledWindow();
TextView yourTextView = new TextView();
private void OnDeleteEvent(object sender, DeleteEventArgs a)
a.RetVal = true;
View this message in context: http://www.nabble.com/Gtk--TextView-and-Scrolling-Text-tp17653284p17664545.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
More information about the Gtk-sharp-list