[Gtk-sharp-list] Problems using TextView

Raśl Moratalla raul.moratalla@ono.com
Tue, 8 Feb 2005 15:12:24 +0100

Hello, I am using a TreeView with a buffer in my application.
This TreeView is a log, so It will kept a lot of text.
The application runs fine but at some point I get the following error when I 
add some text to the TreeView:

Unhandled Exception: System.NullReferenceException: Object reference not set 
to an instance of an object
in <0xff0f66f5> (wrapper managed-to-native) Gtk.Application:gtk_main ()
in <0x00004> (wrapper managed-to-native) Gtk.Application:gtk_main ()
in <0x00007> Gtk.Application:Run ()
in <0x00121> eLePhantGTK.eLePhantGTK:.ctor (string[])
in <0x0001f> eLePhantGTK.eLePhantGTK:Main (string[])

The sentence that causes this crash is the following:
buffer.Text = buffer.Text + newline;

Also, when I add some lines and I scroll down the TreeView the application 
crashes with any of the errors above:

Gtk-ERROR **: file gtktextiter.c: line 1809 
(forward_line_leaving_caches_unmodified): assertion failed: 
(!_gtk_text_line_is_last (new_line, real->tree))

Or this:
Xlib: unexpected async reply (sequence 0x4a65)!
The program '<unknown>' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAtom (invalid Atom parameter)'.
  (Details: serial 20370 error_code 5 request_code 18 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

My application doesn't have an asinchronous gui, so I think that this could be 
the cause. I don't know how to implement an asinchronous gui because the main 
processes are in a dll that is platform independent, so it can compile in 
windows with .net or with mono in linux.

Any advice with this problem solve be very apreciated :)