Re: GtkCellrendererpixbuf



On Thursday 22 January 2004 20:04, Harring Figueiredo wrote:

 How do I bind a pixbuf to a cell ?

 Currently I create several "icons" and use set on model with the icon that
I want to display on the treeview; however, I read somewhere that there is
a different/easier way to do that -- The icons I will use are all from the
GTK STOCK.

Instead of binding the cell renderer's "pixbuf" property to a model column of 
type GDK_TYPE_PIXBUF, bind the cell renderer's "stock-id" property to a model 
column of type G_TYPE_STRING, and set the "stock-size" property when you 
create the renderer with g_obect_set().

That should do it (I hope).  There's a stock item browser in the gtk source 
tree under demos/gtk-demo/stock_browser.[ch] for some code to look at.

Cheers
-Tim





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