[PATCH] making GtkTextBuffer::set_text() accept single param

From: Date: Mon, 12 Sep 2005 13:52:51 +0000
Subject: [PATCH] making GtkTextBuffer::set_text() accept single param
Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-1635@lists.php.net to get a copy of this message
I don't have a test script for this, I just want to keep it somewhere safe for now (and can't see any reason for it to fail). Compiles OK. GtkImageMenuItem's constructor represents the stock_id parameter as 'u' (encoded string) rather than as 's' (string) - this is the only place in the overrides where stock_id's represented that way. Should the others also accept encoded strings, or is it a typo? - Steph

Index: ext/gtk+/gtktextview.overrides =================================================================== RCS file: /repository/php-gtk/ext/gtk+/gtktextview.overrides,v retrieving revision 1.2 diff -u -r1.2 gtktextview.overrides --- ext/gtk+/gtktextview.overrides 31 Jul 2005 10:12:19 -0000 1.2 +++ ext/gtk+/gtktextview.overrides 12 Sep 2005 13:28:47 -0000 @@ -120,4 +120,32 @@ phpg_gboxed_new(&return_value, GTK_TYPE_TEXT_ITER, &iter, TRUE, TRUE TSRMLS_CC); } +%% +add-arginfo GtkTextBuffer set_text +static +ZEND_BEGIN_ARG_INFO(ARGINFO_NAME, 0) + ZEND_ARG_INFO(0, text) + ZEND_ARG_INFO(0, len) +ZEND_END_ARG_INFO(); + +%% +override gtk_text_buffer_set_text +PHP_METHOD +{ + + int len = 0; + + NOT_STATIC_METHOD(); + if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "u|i", &text, &php_len)) + return; + + if (!php_len) { + len = strlen(text); + } else { + len = php_len; + } + + gtk_text_buffer_set_text(GTK_TEXT_BUFFER(PHPG_GOBJECT(this_ptr)), text, len); +} + %% }}}
« previous php.gtk.dev (#1635) next »