Re: real gtk question: treeview
- From: Jonathan Blandford <jrb redhat com>
- To: Jacob Perkins <jap1 users sourceforge net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: real gtk question: treeview
- Date: 06 Sep 2002 16:30:41 -0400
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,
"key_list"));
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,
G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING);
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",
-1);
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
http://developer.gnome.org/doc/API/2.0/gtk/treewidget.html
for an example.
-Jonathan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]