GtkCTree : replacing a node with another node



I am trying to replace a node in a GtkCTree and I think I've found a
bug.

I start with:

a = gtk_ctree_insert_node ( GTK_CTREE(gCtree), NULL, NULL,
    pszArray, 0, NULL, NULL, NULL, NULL, FALSE, FALSE);
b = gtk_ctree_insert_node ( GTK_CTREE(gCtree), a, NULL,
    pszArray, 0, NULL, NULL, NULL, NULL, FALSE, FALSE);
c = gtk_ctree_insert_node ( GTK_CTREE(gCtree), b, NULL,
    pszArray, 0, NULL, NULL, NULL, NULL, FALSE, FALSE);

Which works fine to make a tree where a->b->c


I want to replace b though, so I do the following:

/* remove old b */
gtk_ctree_remove_node(GTK_CTREE(gCtree), b);

/* make new b */
b = gtk_ctree_insert_node ( GTK_CTREE(gCtree), a, c,
    pszArray, 0, NULL, NULL, NULL, NULL, FALSE, FALSE);

Which causes my application to crash, and if I reverse the order of the
calls and I try:

/* make new b */
newb = gtk_ctree_insert_node ( GTK_CTREE(gCtree), a, c,
    pszArray, 0, NULL, NULL, NULL, NULL, FALSE, FALSE);

/* remove old b */
gtk_ctree_remove_node(GTK_CTREE(gCtree), b);


only "a" is displayed in the list and nothing beyond that.

Has anybody else ran into similar problems?


I cannot seem to get ctk_ctree_insert_node to work when I specify a
child, and it appears that gtk_ctree_remove_node deletes all it's
children.  How do I remove JUST a single node?

Thanks,
-Rich




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