Re: GtkListStore->insert()

From: Date: Wed, 19 Oct 2005 20:38:40 +0000
Subject: Re: GtkListStore->insert()
References: 1 2 3 4  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-1863@lists.php.net to get a copy of this message
Should be fixed in CVS now. Try again. -Andrei On Oct 15, 2005, at 9:50 AM, Scott Mattocks wrote:
Hi Andrei, Andrei Zmievski wrote:
I ended up taking your patch and expanding it. Should be in CVS now, let me know if it works for you. It actually does a little more than GtkListStore::insert(position, array items = null)
I am running into some strange problems using insert with an array. Sometimes it gives me warning about things being initialized to NULL already. I added bug_gtkliststore_insert_with_array.php to the test file. It has more details and you should be able to reproduce the bug with that script. Also, I copied the override for GtkListStore::append and changed the method name and Gtk function to prepend. The attached patch is your code with two words changed. Thanks, Scott
--- gtktreeview.overrides    2005-10-14 12:48:41.566336864 -0400
+++ gtktreeview.overrides.prepend    2005-10-13 23:00:19.000000000 -0400
@@ -161,6 +161,26 @@ } %% +override gtk_list_store_prepend +PHP_METHOD +{
+    GtkTreeIter iter;
+    zval *items = NULL;
+
+    NOT_STATIC_METHOD();
+
+    if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "|a", &items))
+        return;
+
+    gtk_list_store_prepend(GTK_LIST_STORE(PHPG_GOBJECT(this_ptr)), &iter);
+
+    if (items && phpg_model_set_row(GTK_TREE_MODEL(PHPG_GOBJECT(this_ptr)), &iter, items) == FAILURE)
+        return;
+
+    phpg_gboxed_new(&return_value, GTK_TYPE_TREE_ITER, &iter, TRUE, TRUE TSRMLS_CC);
+} + +%% override gtk_list_store_insert PHP_METHOD { --PHP-GTK Development Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.gtk.dev (#1863) next »