[Gtk-sharp-list] Scribble with Glade?

Sebastian Vorköper sv@fogman.de
Sun, 28 Mar 2004 06:07:40 +0200


Ok,

i did what you suggested, but it fails to compile.
It complains:

basti@lemming scribble $ mcs Scribble.cs /r:gtk-sharp.dll
/r:gdk-sharp.dll /r:glade-sharp.dll
Scribble.cs(44) error CS0120: An object reference is required for the
non-static field `darea'
Scribble.cs(57) error CS0120: An object reference is required for the
non-static field `darea'
Scribble.cs(59) error CS0170: Use of possibly unassigned field `Width'
Scribble.cs(60) error CS0120: An object reference is required for the
non-static field `pixmap'
Scribble.cs(74) error CS0120: An object reference is required for the
non-static field `pixmap'
Scribble.cs(77) error CS0120: An object reference is required for the
non-static field `darea'
Scribble.cs(84) error CS0120: An object reference is required for the
non-static field `pixmap'
Scribble.cs(107) error CS0120: An object reference is required for the
non-static field `pixmap'
Compilation failed: 8 error(s), 0 warnings

So I did
...
[Glade.Widget] static Gtk.DrawingArea darea;
[Glade.Widget] static Gdk.Pixmap pixmap;
...

This compiles fine but does not work.
Output:

basti@lemming scribble $ mono
Scribble.exe                                                                                
 
Unhandled Exception: System.NullReferenceException: A null value was
found where an object instance was required.
in (unmanaged) (wrapper managed-to-native)
SignalConnector:glade_xml_signal_autoconnect_full
(intptr,Glade.XML/SignalConnector/RawXMLConnectFunc,intptr)
in <0x00004> (wrapper managed-to-native)
SignalConnector:glade_xml_signal_autoconnect_full
(intptr,Glade.XML/SignalConnector/RawXMLConnectFunc,intptr)
in <0x00077> SignalConnector:Autoconnect ()
in <0x00050> Glade.XML:Autoconnect (object)
in <0x00055> GtkSamples.GladeTest:.ctor (string[])
in <0x00020> GtkSamples.GladeTest:Main (string[])
 
I've put the signal handlers for the Scribble Methods into the Glade
file.
I must be missing something!
Please help anybody.

Thanks,
Sebastian Vorköper
sv@fogman.de