[Glade-users] images
mw158979
newbie at poczta.gazeta.pl
Sun Jan 1 17:20:55 EST 2006
> i m doing a project in glade .
> and now a days working at its interfaces ...
> so i m facing problem in how to insert a image in interface as i found no
> related code.
Glade offers image widget. Unfortunatelly it did not work
for me - win98. The code it generates is as follows:
/***********************************************************************/
image1 = create_pixmap (window1, "filename.png");
gtk_widget_show (image1);
gtk_container_add (GTK_CONTAINER (window1), image1);
/***********************************************************************/
I tried with another file, other format, full path, but perhaps
there is just a bug.
Instead of "image1 = create_pixmap (window1, FILENAME);"
you can use gtk_image_new_from_file function like this:
image1 = gtk_image_new_from_file(FILENAME);
Then you should add this widget to its destination container,
like glade adds it above. It worked for me with a jpg file.
cheers
More information about the Glade-users
mailing list