Re: php_gtk_parse_args problems

From: Date: Tue, 13 Mar 2007 19:59:38 +0000
Subject: Re: php_gtk_parse_args problems
References: 1  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-3779@lists.php.net to get a copy of this message
Hi Arx, You'll find everything you need in main/php_gtk_util.c (parse_arg_impl()). "u" refers to UTF-8 encoding - you need to have a copy there to free as necessary following encoding. See the overrides for gtk_button_new_from_stock. That said, the error message implies that you haven't set up your enums properly somehow, but you haven't shown us any code that would explain why. - Steph ----- Original Message ----- From: "Arx Cruz" <arxcruz@gmail.com> To: <php-gtk-dev@lists.php.net> Sent: Tuesday, March 13, 2007 7:25 PM Subject: [PHP-GTK-DEV] php_gtk_parse_args problems
Hello all, First all, this is my first post here, and sorry my english. I've trying to make a binding of VteTerminal to php-gtk2. Untill now things works pretty good, i could be able to create vte.defs config.m4, Makefile.frag, i'm able to generate gen_vte.c. But... some methods couldnt be parsed to gen_vte.c and i must make it myself with vte.overrides. vte_terminal_fork_command is the method i want to override, since parse dont work. the sign of this method is:
pid_t       vte_terminal_fork_command       (VteTerminal *terminal,
                                           const char *command,
                                           char **argv,
                                           char **envv,
                                           const char *directory,
                                           gboolean lastlog,
                                           gboolean utmp,
                                           gboolean wtmp);
so i put in vte.overrides this code: override vte_terminal_fork_command PHP_METHOD { const char *directory, *command; if(!php_gtk_parse_args(ZEND_NUM_ARGS(), "uu", &command, &directory)) {
        return;
} vte_terminal_fork_command(VTE_TERMINAL(PHPG_OBJECT(this_ptr)), (const char*)command, NULL, g_listenf(), (const char*)directory, FALSE, FALSE, FALSE); } all compile fine, but when i try to use VteTerminal->fork_command("directory", "command"); I got a error like this: phpg_register_enum: assertion `g_type_is_a(gtype, ((GType) ((12) << (2))))´ failed then a segment fault. I wonder how workis this php_gtk_parse_args (what's mean uu, s, a and so on) if someone could help me, i'll be thankfull and php-gtk will will a new binding :) Cheers! Arx Cruz -- "A fé remove montanhas, mas eu prefiro a dinamite"


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