Re: gtktreeview / multiple cell renderers



On Thu, 2005-02-10 at 14:46 +0100, Denis wrote:
Hi everybody,

Hi,

I am trying to build a tree_view on top of a GtkTreeModel I made and I 
would like to see in each cell an icon of the gtk stock by giving its 
stock-id and a text.

Instead of using the "pixbuf" property you can use the "stock-id"
property and just specify a string - e.g. GTK_STOCK_YES.

What is the correct code to do that ?
Should I implement my own cell renderer ? (hopfully no...)

No.

I attached the code I have currently : it works partially : the 
pixbuf_cell_renderer is added to the layout with expand = TRUE which is 
not what I want and I get theses messages on the standard output :
GLib-GObject-WARNING **: IA__g_object_set_property: object class 
`GtkCellRendererPixbuf' has no property named `text'

This error basically says you have tried to associate the "text"
attribute with the pixbuf cell renderer.  

The "text" attribute should be associated with the GtkCellRendererText
and the "pixbuf" or "stock-id" attribute associated with the
GtkCellRendererPixbuf.

I looked at many examples but never found one where both the icon and 
the text were computed with the content of the cell :-(

Have a look at these posts:
http://mail.gnome.org/archives/gtk-app-devel-list/2002-
September/msg00086.html
http://mail.gnome.org/archives/gtk-app-devel-list/2003-
July/msg00301.html

Thank you by advance for your help,

No worries ;)

-- 
Regards,
Martyn



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