[Gtk-sharp-list] TreeSelection Critical Warnings

Pablo Fischer pablo@pablo.com.mx
Sat, 18 Oct 2003 14:34:08 -0500


Hi!

I have a treeview with some data, however If I dont select a row and try
to do something with it the application crases returning a
NullReferenceValue, so I found 2 options, but I don't know how to do
this in gtksharp (I think it's something related with TreeSelection)

1. Every time the treeview appears, select by default a row (the first
one).
2. Im trying for now with an Exception (and it works), but the output
is:

(<unknown>:2091): Gtk-CRITICAL **: file gtktreestore.c: line 568
(gtk_tree_store_get_path): assertion `iter->user_data != NULL' failed

(<unknown>:2091): Gtk-CRITICAL **: file gtktreestore.c: line 635
(gtk_tree_store_get_value): assertion `iter->stamp == GTK_TREE_STORE
(tree_model)->stamp' failed

(<unknown>:2091): GLib-GObject-CRITICAL **: file gvaluetypes.c: line 778
(g_value_get_string): assertion `G_VALUE_HOLDS_STRING (value)' failed

How I'm 'catching' it?, with this code:

    try {
      LoadAccountInfoWindow(Convert.ToInt32((string)value));
    } catch(System.NullReferenceException ex) {
      Console.WriteLine("Go away..");
    }

Thanks!
Pablo
-- 
Pablo Fischer Sandoval (pablo [arroba/at] pablo.com.mx)
http://www.pablo.com.mx
http://www.debianmexico.org
GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C
Firma URL: http://www.pablo.com.mx/firmagpg.txt