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

From: Date: Sun, 07 Aug 2011 23:10:15 +0000
Subject: GtkTreeStore::insert_before() - Bug or doc error?
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-8543@lists.php.net to get a copy of this message
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.

« previous php.gtk.general (#8543) next »