RE: Pixbuf treeview question



From Tim-Phillip Mullers excellent treeview tutorial:
"The tree store will not make a copy of the object, rather it will
increase
the object's ref count"

I would rather that it did make a copy of the object.

I wanted to insert a pixbuf into a cell, and when I needed to change
it ,
retrieve it, amend it and put it back.

Does this mean that I have to set up an array, g_array, linked list or
similar
data structure to store my pixbufs? What is the most elegant way to do
this?

You can use the following to get the pixbuf:

        GdkPixbuf *pb = NULL;
        gtk_tree_model_get (model, &iter, COLUMN_ONE, &pixbuf, -1);


This (as Tim says) increases the ref count, so you will need to call 

        g_object_unref (G_OBJECT (pb));


Regards,
Martyn



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