Re: packing multiple renderers into columns



i have managed to do it... but it is not very clear from the documentation that it is possible at all...

this is what i did:

  GtkCellRenderer *renderer_text;
  GtkCellRenderer *renderer_image;
  GtkTreeViewColumn *column;

  column = gtk_tree_view_column_new();

  /* COL_IMAGE */
  renderer_image = gtk_cell_renderer_pixbuf_new();
  gtk_tree_view_column_pack_start(column,renderer_image,FALSE);
  gtk_tree_view_column_add_attribute(column,
                                     renderer_image,
                                     "pixbuf",COL_IMAGE);  
  
  /* COL_NAME */
  renderer_text = gtk_cell_renderer_text_new();
  gtk_tree_view_column_pack_end(column,renderer_text,TRUE);
  gtk_tree_view_column_add_attribute(column,
                                     renderer_text,
                                     "text",COL_NAME);

  /* insert column */
  gtk_tree_view_insert_column(GTK_TREE_VIEW(treeview),column,-1);


If this is wrong, let me know Shahms, thanx for you your support.

regards,

Martyn



 from:    "Shahms E. King" <shahms shahms com>
 date:    Tue, 13 Aug 2002 18:15:44
 to:      gtk-app-devel-list gnome org
 subject: Re: packing multiple renderers into columns

I've done it and had no problems, what, exactly, are you trying to do?
You might want to search for a previous thread (or discussion) between
Arno and I about the GtkTreeView in general; I touched on how to add
multiple renderers into one column.  Specifically it's discussed in the
thread "Conversion GtkCTree in GTK 1.2 to GtkTreeView in GTK 2"

--Shahms


On Tue, 2002-08-13 at 10:02, ginxd btopenworld com wrote:
has anyone done this yet? surely someone must have?

I'm looking to put 2 cell renderers (pixbuf and text) in the same column using 
gtk_tree_view_column_pack_start/end.


I've tried, and it doesnt work correctly for me.

Regards,

Martyn
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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