how to set GtkTreeViewColumn text if it contains > 1 cell renderers?



Hi,

I added a GtkCellRendererText to a GtkTreeViewColumn. GtkTreeViewColumn now
consists of two parts. How to set the value of the second part?

To understand my question apply the patch to demos/gtk-demo/editable_cells.c,
run 'Editable Cells' example, click at the right area of "Product" column
(You'll get a Gtk-CRITICAL). The question: how to set the initial text of that
empty area?

Thanks in advance,
    Vitaly.
? patch
Index: editable_cells.c
===================================================================
RCS file: /cvs/gnome/gtk+/demos/gtk-demo/editable_cells.c,v
retrieving revision 1.7
diff -u -r1.7 editable_cells.c
--- editable_cells.c	29 Sep 2002 21:24:21 -0000	1.7
+++ editable_cells.c	6 Nov 2002 11:27:25 -0000
@@ -222,6 +222,13 @@
 					       "text", COLUMN_PRODUCT,
 					       "editable", COLUMN_EDITABLE,
 					       NULL);
+
+  {
+      GtkCellRenderer* renderer = gtk_cell_renderer_text_new ();
+      g_object_set (G_OBJECT (renderer), "editable", TRUE, NULL);
+      gtk_tree_view_column_pack_end (gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), COLUMN_PRODUCT), renderer, TRUE);
+  }
+
 }
 
 GtkWidget *


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