Trees...



Hi,

I've been playing with trees (I really like this widget type).  What I found is
that if I use gtk_tree_item_set_subtree before adding this very item to a tree,
the program just crashes with sigsegv.  I.e. code

    item = gtk_tree_item_new_with_label ("my item");

    subtree = create_subtree_in_some_way ();

    gtk_tree_item_set_subtree (GTK_TREE_ITEM (item), subtree);

    gtk_tree_append (GTK_TREE (parent), item);

is not the same as

    item = gtk_tree_item_new_with_label ("my item");

    subtree = create_subtree_in_some_way ();

    gtk_tree_append (GTK_TREE (parent), item);

    gtk_tree_item_set_subtree (GTK_TREE_ITEM (item), subtree);

In first case, the program just crashes, in the second, I get what I want to
have.  Looks like the program crashes at (gtk/gtktreeitem.c:335):

  GTK_TREE(subtree)->root_tree = GTK_TREE(GTK_WIDGET(tree_item)->parent)->root_tree;

I do not know too much in gtk's ideology, so I cannot propose a workaround that
would comply it.


Cheers,

    --Mike



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