Changing Pixbuf attached to a GooCanvasImage



Hello !

Just a simple answer. If I build a new goocanvasimage item, with a pixbuf named, for example, "pb1", and, in a second time, modify the object corresponding to my goocanvasimage, by using of G_object_set() on the "pixbuf" field, I've noticed that the image shown changes on the screen, it's OK for me.

short example to explain
--------------
GdkPixbuf* pb1, *pb2;

/* we suppose pb1 & pb2 correctly initialized */

GooCanvasItem* pDrawings=goo_canvas_image_new(ancestor,pb1, 320, 200 , NULL);

/* at this moment, the image is hown using the pb1 pixbuf */
/* then I modifiy the image as follows */
 g_object_set(G_OBJECT(pDrawings), "pixbuf", pb2,  NULL);/* modifiy visible object */
/* is the pb1 pixbuf is freed ???? */
----------------

But, the concern is : the old pixbuf is freed by goocanvas or remains in memory, and, in this case, how to access to the old pixbuf, since the "pixbuf" field of the goocanvasimage item is "write only".

Regards

Luc (ella team, ella renaissance project)


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