[Gtk-sharp-list] Pixbuf behaviour - bug?

Sebastian scut@nb.in-berlin.de
Fri, 9 May 2003 18:19:59 +0200


Hi,

I use mono 0.24, gtk-sharp 0.9 (Debian packages). I tried to compile and run
this program:


using Gtk;
using Gdk;
using System;


public class TestImage {
	public static void Main (string[] args)
	{
		Console.WriteLine ("file: {0}", args[0]);

		try {
			Pixbuf pb = new Pixbuf (args[0]);
		} catch (GLib.GException e) {
			Console.WriteLine ("failed to open {0}", args[0]);
			Environment.Exit (1);
		}
	}
}


Compiled with:

mcs -r gtk-sharp -r gdk-sharp -r glib-sharp test.cs
(which worked just fine).

Then I tried to load some picture:

$ ./test.exe /tmp/spiegel.gif 
file: /tmp/spiegel.gif

(./test.exe:1685): GLib-GObject-CRITICAL **: gtype.c:1875: initialization
assertion failed, use g_type_init() prior to this function

(./test.exe:1685): GLib-GObject-CRITICAL **: gtype.c:1875: initialization
assertion failed, use g_type_init() prior to this function

(./test.exe:1685): GLib-GObject-CRITICAL **: file gobject.c: line 615
(g_object_new): assertion `G_TYPE_IS_OBJECT (object_type)' failed

Unhandled Exception: System.NullReferenceException: A null value was found
where an object instance was required
in (unmanaged) 06 Gdk.Pixbuf:gdk_pixbuf_new_from_file (string,intptr&)
in <0x00004> 06 Gdk.Pixbuf:gdk_pixbuf_new_from_file (string,intptr&)
in <0x00066> 00 Gdk.Pixbuf:.ctor (string)
in <0x00069> 00 .TestImage:Main (string[])


As the exception is not within my code and I call the constructor correctly,
I assume its a bug in Gtk-sharp. Anyone?


ciao,
Sebastian

-- 
-. scut@nb.in-berlin.de -. + http://segfault.net/~scut/ `--------------------.
-' segfault.net/~scut/pgp `' 5453 AC95 1E02 FDA7 50D2 A42D 427E 6DEF 745A 8E07
`- W88 heads sold. 4 payloads ready, payment due. hi echelon! ---------------'