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

From: Date: Mon, 12 Sep 2005 17:07:46 +0000
Subject: Re: [PATCH] making GtkTextBuffer::set_text() accept single param
References: 1  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-1636@lists.php.net to get a copy of this message
Any text passed to Gtk+ should be in UTF-8, so yes, "u" is appropriate. Don't forget to free the converted string, for example: static PHP_METHOD(Gtk, accel_map_add_entry) {
    char *accel_path;
    zend_bool free_accel_path;
    long accel_key;
    GdkModifierType accel_mods;
    zval *php_accel_mods = NULL;
    if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "uiV", &accel_path, &free_accel_path, &accel_key, &php_accel_mods))
        return;
    if (php_accel_mods && phpg_gvalue_get_flags(GDK_TYPE_MODIFIER_TYPE, php_accel_mods, (gint *)&accel_mods) == FAILURE) {
        return;
    }
    gtk_accel_map_add_entry(accel_path, (guint)accel_key, accel_mods);
    if (free_accel_path) g_free(accel_path);
} -Andrei On Sep 12, 2005, at 6:52 AM, Steph wrote:
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 <textbuffer.txt>-- PHP-GTK Development Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


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