[Gtk-sharp-list] Help

Christian Rudh chrru169@student.liu.se
03 Feb 2003 21:04:25 +0100


I followed your example and did almost exactly as you did in glade-2 and
then I wrote this code (very similar to yours):

namespace project1{
using System;
using Gtk;
using Glib;
using GtkSharp;
using Glade;

public class MyForm{
Glade.XML ui;
Button button1;

Entry entry1;

public MyForm(){
ui = new Glade.XML("project1.glade", "window1", null);
ui.Autoconnect (this);


void on_button_clicked(object o, EventArgs e){
Console.WriteLine("I got clicked");

public class Boot{
public static void Main(){
MyForm f = new MyForm();

It compiles fine. But when I try to run it i get:

Unhandled Exception: System.NullReferenceException: A null value was
found where an object instance was required
in (unmanaged) 06 .SignalConnector:glade_xml_signal_autoconnect_full
in <0x00004> 06 .SignalConnector:glade_xml_signal_autoconnect_full
in <0x0006a> 00 .SignalConnector:Autoconnect ()
in <0x00054> 00 Glade.XML:Autoconnect (object)
in <0x0005d> 00 project1.MyForm:.ctor ()
in <0x00031> 00 project1.Boot:Main ()

This seems to come from:

ui.Autoconnect (this);

There is a project1.glade-file and there is a window1. Any suggestions?

Christian Rudh <chrru169@student.liu.se>