[Gtk-sharp-list] Glade using resources

underdog10 at netcourrier.com underdog10 at netcourrier.com
Mon Jul 4 13:08:33 EDT 2005


Hello,

I would like to load image from resources using a glade interface.
I try this 2 method without success:

//Glade.XML gxml = new Glade.XML(null, "testgui.glade", "window1", null);

Glade.XML gxml = Glade.XML.FromAssembly ("testgui.glade", "window1", null);

When i say without success, i mean it fail because galde is looking for the file on disk not in built in resources.

I can set the gui icon using:
window1.Icon = Gdk.Pixbuf.LoadFromResource ("testicon.png");

So is there anyway to load image from resources using a glade interface?

Thanks


--Error here---
(<unknown>:2000): GLib-CRITICAL **: g_path_get_dirname: assertion `file_name != NULL' failed

(<unknown>:2000): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_from_file_utf8: assertion `filename != NULL' failed

(<unknown>:2000): libglade-WARNING **: Couldn't find image file: "test.png"

(<unknown>:2000): GLib-CRITICAL **: g_path_get_dirname: assertion `file_name != NULL' failed

(<unknown>:2000): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_from_file_utf8: assertion `filename != NULL' failed
Glade GUI error: Object reference not set to an instance of an object

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
in <0x000f4> Test.Gui.MyGui:.ctor ()
in <0x0006a> Test.MainClass:Main (System.String[] args)

-------------------------------------------------------------
NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar...
Web/Wap : www.netcourrier.com
Téléphone/Fax : 08 92 69 00 21 (0,34 € TTC/min)
Minitel: 3615 NETCOURRIER (0,16 € TTC/min)



More information about the Gtk-sharp-list mailing list