[Gtk-sharp-list] Exception with Gtk.combo

Fredrik Hedberg fhedberg-mono-lists@avafan.com
Mon, 28 Jun 2004 19:13:38 +0200


You need to add [Glade.Widget] as an attribute to combo1 as you did with
button1, or autoconnect fails and the combo1 object remains null.

Regards

/Fred

On Mon, 2004-06-28 at 18:55 +0200, Christoph Schweda wrote:
> Hello,
> 
>   I have tested the Mono Handbook example for glade. It works fine, but
> after adding a combo field and reading the text of it, I got an
> exception. I don't know if it is a bug or my mistake. The code is
> attached with the email.
> 
> The exception after clicking the button:
> =======================================================================
> Unhandled Exception: System.NullReferenceException: Object reference not
> set to an instance of an object
> in [0x0000b] (at /home/chris/devel/Mono/gDVBszap/Main.cs:94)
> GladeSamples.GladeTest:on_button1_clicked (object,System.EventArgs)
> in <0x0006a> (wrapper delegate-invoke)
> System.MulticastDelegate:invoke_void_object_EventArgs
> (object,System.EventArgs)
> in <0x00120> GtkSharp.voidObjectSignal:voidObjectCallback (intptr,int)
> in <0x00055> (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 [0x00023] (at /home/chris/devel/Mono/gDVBszap/Main.cs:87)
> GladeSamples.GladeTest:.ctor (string[])
> in [0x00001] (at /home/chris/devel/Mono/gDVBszap/Main.cs:74)
> GladeSamples.GladeTest:Main (string[])
> =======================================================================
> 
> Thanks
> Christoph