Re: real gtk question: treeview

Jacob Perkins <jap1 users sourceforge net> writes:

I'm trying to use gtktreeview with gtkliststore as the model, but I keep
running into problems.  Here's some relevant code:

GtkTreeView *key_list = GTK_TREE_VIEW (lookup_widget (key_manager,
      GtkTreeViewColumn *keyid = gtk_tree_view_column_new ();
      gtk_tree_view_column_set_title (keyid, "Key ID");
      gtk_tree_view_append_column (key_list, keyid);
GtkListStore *list = gtk_list_store_new (5, G_TYPE_STRING, G_TYPE_INT,
      gtk_tree_view_set_model (key_list, GTK_TREE_MODEL (list));
      GtkTreeIter iter;
      gtk_list_store_append (list, &iter);
      gtk_list_store_set (list, &iter, 0, "hi", 1, 0, 2, 0, 3, "hi", 4, "hi",

When I run this, I get the following output many, many times:

(seahorse2:6795): Gtk-CRITICAL **: file gtktreeviewcolumn.c: line 2246
(gtk_tree_view_column_cell_set_cell_data): assertion
`tree_column->cell_list != NULL' failed

I get all the named columns just fine, and when I have the
list_store_append line, I can select the top row, but there is no data
in it.

You need to add a cell renderer to the column.  Look at
for an example.


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