[Gtk-sharp-list] Multiple Window Objects and Reference Exceptions

Pablo Fischer pablo@pablo.com.mx
Wed, 19 Nov 2003 22:31:41 -0600


Hi all!

Well, now I have another problem. I'm working with 3 Objects that are
extended from the Gtk.Window class. 

I can open other window.. and close it, but when I try to reopen it, my
application crashes with the following exception:

Unhandled Exception: System.NullReferenceException: A null value was
found where an object instance was required

I dont know why it's crashing, but let me explain how Im creating the
object:

In the constructor I load the glade file where I have my window, then I
Autoconnect it to my app (just with ui.Autoconnect(this)), then in the
function ShowWindow I just 'copy' the glade widgets to gtk widgets, and
that's all.

Im creating the object with:
    private void ShowAccountsWindow() {
      if(aw == null) {
	aw = new AccountsWindow(this, accounts);
	aw.ShowWindow();
      }

      else {
	aw.ShowWindow();
      }
    }

I've also tried with the IsActive property but too, it fails :(.

Am I missing something?

Thanks!
Pablo

Unhandled Exception: System.NullReferenceException: A null value was
found where an object instance was required
in <0x0015d> mBloggy.AccountsWindow:ShowWindow ()
in <0x0007f> mBloggy.mBloggy:ShowAccountsWindow ()
in <0x0000e> mBloggy.mBloggy:on_preferences_button_clicked
(object,System.EventArgs)
in <0x0005a> (wrapper delegate-invoke)
System.MulticastDelegate:invoke_void_object_EventArgs
(object,System.EventArgs)
in <0x0012b> GtkSharp.voidObjectSignal:voidObjectCallback (intptr,int)
in <0x00030> (wrapper native-to-managed)
GtkSharp.voidObjectSignal:voidObjectCallback (intptr,int)
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 <0x003ab> mBloggy.mBloggy:.ctor (string[])
in <0x00024> mBloggy.mBloggy:Main (string[])



-- 
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