assertion `VALID_ITER (parent, tree_store)' failed?
- From: Micheal Smith <xulfer cheapbsd net>
- To: gtk-app-devel-list gnome org
- Subject: assertion `VALID_ITER (parent, tree_store)' failed?
- Date: Wed, 24 Mar 2010 23:59:59 -0500
I'm trying to add something to a treeview based on a row reference.
However when I try to do this I keep getting the error referenced within
the subject. Perhaps I'm doing something wrong, but I can't figure it
out for the life of me.
Here is some test code I wrote up...
static void
populate_leftpane(GtkWidget *leftpane_treeview,
struct interface_data *intdata) {
GtkTreeStore *treestore;
GtkTreeIter toplevel, child;
GtkTreeViewColumn *col;
GtkTreePath *path;
GtkTreeRowReference *ref;
GtkCellRenderer *renderer;
GtkTreeSelection *selection;
col = gtk_tree_view_column_new();
gtk_tree_view_append_column(GTK_TREE_VIEW(leftpane_treeview), col);
renderer = gtk_cell_renderer_text_new();
gtk_tree_view_column_pack_start(col, renderer, TRUE);
gtk_tree_view_column_add_attribute(col, renderer, "text", 0);
treestore = gtk_tree_store_new(1, G_TYPE_STRING);
gtk_tree_store_append(treestore, &toplevel, NULL);
gtk_tree_store_set(treestore, &toplevel, 0, "Test1", -1);
gtk_tree_store_append(treestore, &toplevel, NULL);
gtk_tree_store_set(treestore, &toplevel, 0, "Test2", -1);
gtk_tree_store_append(treestore, &toplevel, NULL);
gtk_tree_store_set(treestore, &toplevel, 0, "Test3", -1);
path = gtk_tree_model_get_path(GTK_TREE_MODEL(treestore), &toplevel);
ref = gtk_tree_row_reference_new(GTK_TREE_MODEL(treestore), path);
gtk_tree_path_free(path);
intdata->playlist_node_ref = ref;
// I know this code isn't very useful, but I'm just attempting to
use this
// to test / describe my issue.
path = gtk_tree_row_reference_get_path(ref);
gtk_tree_model_get_iter(GTK_TREE_MODEL(treestore), &toplevel, path);
// The following line is what triggers the failed assertion.
gtk_tree_store_append(treestore, &toplevel, &child);
gtk_tree_store_set(treestore, &toplevel, 0, "Testing", -1);
gtk_tree_view_set_model(GTK_TREE_VIEW(leftpane_treeview),
GTK_TREE_MODEL(treestore));
selection =
gtk_tree_view_get_selection(GTK_TREE_VIEW(leftpane_treeview));
gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
}
Any comments, or suggestions would be appreciated.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]