[Glade-users] Change an PNG image by athother!

I hope that I understood you right, if not so please tell me more exact 
what you want:

GError *err= NULL;
// load a new image from file
// the gdk_pixbuf... functions provide also image manipulation functionality
GdkPixbuf *buf= gdk_pixbuf_new_from_file ( 

// Then you can lookup the glade generated image name (= Widget Name
// in the glade Properties Dialog)
GtkWidget *widget= lookup_widget (dialog, "WIDGET_NAME");
// now set the new loaded image instead of the old image:
gtk_image_set_from_pixbuf( GTK_IMAGE( widget ), buf);
// do not forget to unref your pic (so that the memory is freed)
gdk_pixbuf_unref( buf );



Hi there!

I want to create an "semaphore" in my program, using a green and a red 
PNG images!

I want to place an green PNG image and change it by another one, a red 

The problem is that, I build my GUI with glade, and I can't find a way 
to load another image in the same spot as the other image...

Any sugestions?!

Thanks in Advance

|    Jos� Pedro S. Rom�o Machado    |
|       (DET/LEET - N�15993)        |
|      Universidade de Aveiro       |
| Dep. de Elect. e Telecomunica��es |
|           (www.ua.pt)             |
Glade-users maillist  -  Glade-users lists ximian com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]