cvs: php-gtk / NEWS /ext/gtk+ gtk.overrides

From: Date: Tue, 27 Nov 2001 19:12:21 +0000
Subject: cvs: php-gtk / NEWS /ext/gtk+ gtk.overrides
Groups: php.gtk.cvs 
Request: Send a blank email to php-gtk-cvs+get-334@lists.php.net to get a copy of this message
andrei Tue Nov 27 14:12:21 2001 EDT Modified files: /php-gtk NEWS /php-gtk/ext/gtk+ gtk.overrides Log: Added GtkList::remove_items() method. Index: php-gtk/NEWS diff -u php-gtk/NEWS:1.52 php-gtk/NEWS:1.53 --- php-gtk/NEWS:1.52 Tue Nov 20 15:36:30 2001 +++ php-gtk/NEWS Tue Nov 27 14:12:21 2001 @@ -1,3 +1,4 @@ + - added GtkList::remove_items() method. (Andrei) - added ability to build extensions as shared libraries and load them selectively. (Andrei) - made libglade work on Win32 platforms. (Frank) Index: php-gtk/ext/gtk+/gtk.overrides diff -u php-gtk/ext/gtk+/gtk.overrides:1.26 php-gtk/ext/gtk+/gtk.overrides:1.27 --- php-gtk/ext/gtk+/gtk.overrides:1.26 Tue Nov 13 15:19:38 2001 +++ php-gtk/ext/gtk+/gtk.overrides Tue Nov 27 14:12:21 2001 @@ -1135,7 +1135,36 @@ gtk_list_insert_items(GTK_LIST(PHP_GTK_GET(this_ptr)), items, position); } %% +override gtk_list_remove_items +PHP_FUNCTION(gtk_list_remove_items) +{ + zval *php_items, **item; + GList *items = NULL; + int i = 0; + + NOT_STATIC_METHOD(); + + if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "a", &php_items)) + return; + + for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(php_items)); + zend_hash_get_current_data(Z_ARRVAL_P(php_items), (void **)&item) == SUCCESS; + zend_hash_move_forward(Z_ARRVAL_P(php_items)), i++) { + if (!php_gtk_check_class(*item, gtk_listitem_ce)) { + php_error(E_WARNING, "%s() needs list item #%d to be a GtkListItem", get_active_function_name(TSRMLS_C), i); + g_list_free(items); + return; + } + + items = g_list_append(items, PHP_GTK_GET(*item)); + } + + gtk_list_remove_items(GTK_LIST(PHP_GTK_GET(this_ptr)), items); + g_list_free(items); +} +%% ignore gtk_list_item_new_with_label + gtk_list_remove_items_no_unref %% override gtk_list_item_new PHP_FUNCTION(gtk_list_item_new)

« previous php.gtk.cvs (#334) next »