Re: another fix

From: Date: Thu, 07 Dec 2006 05:14:40 +0000
Subject: Re: another fix
References: 1  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-3537@lists.php.net to get a copy of this message
Anant, Can you commit this? -Andrei On Nov 6, 2006, at 1:51 PM, Pablo Dall'Oglio wrote:
is it good enough ? I needed get_sel_text so I addapted from php-gtk1 too :-) static PHP_METHOD(GtkScintilla, get_sel_text) {
        zend_bool free_text = FALSE;
        long length;
        char *text;
        GtkScintilla *scintilla = GTK_SCINTILLA(PHPG_GOBJECT(this_ptr));
    NOT_STATIC_METHOD();
        if (!php_gtk_parse_args(ZEND_NUM_ARGS(), ""))
                return;
        length = gtk_scintilla_get_selection_end(scintilla) -
gtk_scintilla_get_selection_start(scintilla) + 1;
        text = emalloc(length);
        text[length-1] = 0;
        gtk_scintilla_get_sel_text(scintilla, text);
        if (free_text) g_free(text);
        RETVAL_STRINGL(text, length-1, 0);
} --:: Pablo Dall'Oglio :: www.dalloglio.net


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