[Gtk-sharp-list] Problem loading icons: is this a bug?

Raśl Moratalla raul.moratalla@ono.com
Fri, 16 Jul 2004 20:42:30 +0200


Hi!

I use glade for edit the interface of my application and I add to a form 
or to a button an icon: When I execute the application I get the 
following error and it crashes:
(<unknown>:31877): GLib-CRITICAL **: file gutils.c: line 577 
(g_path_get_dirname): assertion `file_name != NULL' failed

(<unknown>:31877): GdkPixbuf-CRITICAL **: file gdk-pixbuf-io.c: line 761 
(gdk_pixbuf_new_from_file): assertion `filename != NULL' failed

Unhandled Exception: System.NullReferenceException: Object reference not 
set to an instance of an object
in (unmanaged) (wrapper managed-to-native) 
Glade.XML:glade_xml_new_from_buffer (byte[],int,string,string)
in <0x00004> (wrapper managed-to-native) 
Glade.XML:glade_xml_new_from_buffer (byte[],int,string,string)
in <0x00133> Glade.XML:.ctor 
(System.Reflection.Assembly,string,string,string)
in [0x00017] (at /home/raul/MonoDevelopProjects/glade1/Main.cs:21) 
GladeApp:.ctor (string[])
in [0x00001] (at /home/raul/MonoDevelopProjects/glade1/Main.cs:11) 
GladeApp:Main (string[])


press any key to continue...

It seems that can't load the icon. I looked into the xml file and I can 
see the following line:
  <property name="icon">App.png</property>

I changed it with the complete path to the image and the application now 
loads and shows the icon, but if I want to distribute the source code 
this is a problem. Is this a bug or am I doing something wrong?
I tried to load and assign the icons to my window or my buttons using 
code but I am a bit confused and I don't know how to do it :( (I think 
that I should use Gdk.Pixbuf) Anyone could explain to me how to do it? I 
would to knowt if the application crashes if I assign the icon by code.

Best regards,

Raśl