[Gtk-sharp-list] Strange bug

Ian Parish iparish@novell.com
Thu, 03 Mar 2005 12:00:33 -0700


This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__Part92B1FAC1.1__=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

I saw this and it was very frustrating.  I came to the conclusion that
the .Autoconnect() call that is called when any additional dialog/widget
is loaded is causing the initial lists/variables to be cleared or set to
Null.  I wasn't able to find a fix or work around it(that was easy, I
could have done all the work autoconnect() does manually)  In this
sample code Iconlist1 is set and valid until the
newDialog3XML.Autoconnet() call is made. 
 
 
Glade.XML gxml = new Glade.XML (null, nal.glade, Nal, null); 
         gxml.Autoconnect (this); 
                                                                        
        
         iconlist1 = (Gnome.IconList)gxml.GetWidget(iconlist1);         
                                                                       
 
 
newDialog3XML = new Glade.XML (null, test.glade, dialog3, null); 
//  This call to autoconnet() cause iconlist1 to be set to null 
                              newDialog3XML.Autoconnect (this); 
                                                                        
        
  
Ian 


>>><fmoraes@nc.rr.com> 03/02/05 9:53 pm >>>
This seems to occur on with my dialog (has a TreeView with a custom
ListStore model). It works fine for the first instance of the dialog.
After I close and destroy it, I reopen, remove an item from the list and
try to append a new one and I get the exception below:

Unhandled Exception: System.NullReferenceException: Object reference not
set to
an instance of an object.
  at Gtk.ListStore.gtk_list_store_append(IntPtr raw, TreeIter& iter)
  at Gtk.ListStore.Append()

Any ideas? This is with GTK# 1.92.

Francisco


Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list


--=__Part92B1FAC1.1__=
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <style type=3D"text/css">
      <!--
        body { font-variant: normal; margin-bottom: 1px; margin-top: 4px; =
margin-left: 4px; line-height: normal; margin-right: 4px }
      -->
    </style>
   =20
  </head>
  <body style=3D"margin-bottom: 1px; margin-top: 4px; margin-left: 4px; =
margin-right: 4px">
    <div>
      <DIV>        I saw this and it was very frustrating.&#160;&nbsp;I =
came to the conclusion that the .Autoconnect&#40;&#41; call that is =
called&#160;when&#160;any&#160;additional dialog/widget is loaded is =
causing the initial lists/variables to be cleared or set to Null.&#160;&nbs=
p;I wasn&#39;t able to find a fix or work around it&#40;that was easy&#44; =
I could have done all the work autoconnect&#40;&#41; does manually&#41; =
&nbsp;In this sample code Iconlist1 is set and valid until the newDialog3XM=
L.Autoconnet&#40;&#41; call is made.
      </DIV>
      <DIV>&nbsp;</DIV>
      <DIV>&nbsp;</DIV>
      <DIV>Glade.XML gxml &#61; new Glade.XML &#40;null&#44; &quot;nal.glad=
e&quot;&#44; &quot;Nal&quot;&#44; null&#41;&#59;
      </DIV>
      <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gxml.Autoc=
onnect &#40;this&#41;&#59;
      </DIV>
      <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      </DIV>
      <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iconlist1 =
&#61; &#40;Gnome.IconList&#41;gxml.GetWidget&#40;&quot;iconlist1&quot;&#41;=
&#59; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      </DIV>
      <DIV>&nbsp;</DIV>
      <DIV>&nbsp;</DIV>
      <DIV>newDialog3XML &#61; new Glade.XML &#40;null&#44; &quot;test.glad=
e&quot;&#44; &quot;dialog3&quot;&#44; null&#41;&#59;
      </DIV>
      <DIV>// &nbsp;This call to autoconnet&#40;&#41; cause iconlist1 to =
be set to null
      </DIV>
      <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newDialog3XML.Autoconnect =
&#40;this&#41;&#59;
      </DIV>
      <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      </DIV>
      <DIV>&#160;
      </DIV>
    </div>
    <div>
      <DIV>        Ian
      </DIV>
    </div>
    <DIV>      <br>
      <br>
      &gt;&gt;&gt;&lt;fmoraes@nc.rr.com&gt; 03/02/05 9:53 pm &gt;&gt;&gt;<b=
r>This seems to occur on with my dialog &#40;has a TreeView with a custom =
ListStore model&#41;. It works fine for the first instance of the dialog. =
After I close and destroy it&#44; I reopen&#44; remove an item from the =
list and try to append a new one and I get the exception below:<br><br>Unha=
ndled Exception: System.NullReferenceException: Object reference not set =
to<br>an instance of an object.<br>&#160;&#160;at Gtk.ListStore.gtk_list_st=
ore_append&#40;IntPtr raw&#44; TreeIter&amp; iter&#41;<br>&#160;&#160;at =
Gtk.ListStore.Append&#40;&#41;<br><br>Any ideas&#63; This is with GTK&#35; =
1.92.<br><br>Francisco<br><br><br>Gtk-sharp-list maillist&#160;&nbsp;-&#160=
;&nbsp;Gtk-sharp-list@lists.ximian.com<br>http://lists.ximian.com/mailman/l=
istinfo/gtk-sharp-list<br>    </DIV>

  </body>
</html>

--=__Part92B1FAC1.1__=--