GtkTreeStore::insert_before() - Bug or doc error?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

GtkTreeStore::insert_before() - Bug or doc error?

André Jansen-3
Hi all,

Referring to :
http://gtk.php.net/manual/en/gtk.gtktreestore.method.insert_before.php

Until now I had not used this method nor its companion insert_after() -
the append() method being OK for my requirements. However, at some point
I needed insert_before to solve a specific problem.

It failed to work however, the result being a rather messed up treeview
and lots of warnings such as:
Gtk-CRITICAL **: gtk_tree_store_insert_before: assertion `G_NODE (sibling-
>user_data)->parent == G_NODE (parent->user_data)' failed
Gtk-CRITICAL **: gtk_tree_store_set_value: assertion `VALID_ITER (iter,
tree_store)' failed

Turns out that the argument order is wrong. According to the
documentation the first argument is the sibling iter, the second is the
parent. When I switched these two around, everything worked perfectly as
intended.

This can be tested by running the script as given in the doc page cited
above. It will result in warnings similar to the above, and the tree is
not displayed as intended. Switch the parent and sibling arguments in the
insert_before() calls around, and things will work.

The insert_after() method has the same problem.

The above applies to php-gtk 2.0.1 on NT 5.1 (aka XP), standard windows
binary distribution. I am not sure if it is a bug in the distribution
(and hence the docs are correct) or a documentation error.

Regards,
--
André
===========================================================
Black Holes were created when God divided by zero.


--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php