[Gtk-sharp-list] writing text into TextBuffer causes NullReferenceExceptions and other bad things

Jesse S.A. Bridgewater jsab@pobox.com
Wed, 18 Aug 2004 19:06:56 -0700


I have written a chat program using Glade and Gtk# using the version of
mono in debian unstable.

When I send messages between clients things work sometimes but mostly I
get a combination of these messages:

(<unknown>:11733): Gdk-CRITICAL **: file gdkwindow-x11.c: line 2055
(gdk_window_set_geometry_hints): assertion `window != NULL' failed

(<unknown>:11733): Gdk-CRITICAL **: file gdkwindow-x11.c: line 1416
(gdk_window_resize): assertion `window!= NULL' failed

Unhandled Exception: System.NullReferenceException: Object reference not
set to an instance of an object
in (unmanaged) (wrapper managed-to-native) Gtk.Application:gtk_main ()
in <0x00004> (wrapper managed-to-native) Gtk.Application:gtk_main ()
in <0x00007> Gtk.Application:Run ()
in <0x000ce> Brunet.BrunetChatMain:Main (string[])

The offending code writes strings into a TextBuffer:

   textbufferDisplay.Insert(textbufferDisplay.EndIter,"<"+recipientBuddy.Alias+"> " );
   Console.WriteLine(a_msg ); 

Can anyone tell me what I ma doing wrong?