gtk treeview pix text cell renderer
I want to replace a GtkCList with GtkTreeView, but I can't seem to figure out how to accomplish the same functionality as the gtk_clist_set_pixtext function. I'm guessing I need a custom cell render. Does somebody have a free implementation I can use or am I on my owning in having to writ开发者_JAVA技巧e one from scratch?
I found the answer to my own question
see section 5.3 on this link http://library.gnome.org/devel/gtk/unstable/gtk-question-index.html
Basically, you stuff two renderers into the same widget
Here is some same code I found to accomplish what I want.
cell_renderer = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column,
cell_renderer,
FALSE);
gtk_tree_view_column_set_attributes (column, cell_renderer,
"stock_id", 1, NULL);
cell_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column,
cell_renderer,
TRUE);
精彩评论