Re: PHP-Gtk2 and Reflection

From: Date: Tue, 10 May 2005 14:23:09 +0000
Subject: Re: PHP-Gtk2 and Reflection
References: 1 2 3 4 5  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-1256@lists.php.net to get a copy of this message
Ah ok, this core stuff I better leave to the master. A little digging showed me that in php-gtk/main/phpg_value.c in phpg_gvalue_to_zval() if you return SUCCESS instead of FAILURE in the switch/default branch, it doesn't crash (but it outputs the warning) and your handler gets properly called (though I didn't verify if doing anything serious in this handler continues to work). I think the gpointer in that case isn't needed as you can pass custom php values anyway with signal(), but that's Andrei to do the right thing [tm]. - Markus Christian Weiske wrote:
Where does it crash, do you have a backtrace? Can you provide a small php-gtk source example of it?
PHP Warning: PHP-GTK internal error: unsupported type gpointer in /data/php-gtk/two/problems/notebook_switch.php on line 18 /usr/bin/p5: line 2: 7707 Segmentation fault /data/cvs/php/php5cli/bin/php -c /data/cvs/php/php5cli/bin/ $* <?php class Notebooktest extends GtkWindow {
    public function __construct()
    {
        parent::__construct();
        $this->connect_object('destroy', array('gtk', 'main_quit'));
        $notebook = new GtkNotebook();
        $this->add($notebook);
        $notebook->append_page(new GtkLabel('Page1'), new
GtkLabel('Label1'));
        $notebook->append_page(new GtkLabel('Page2'), new
GtkLabel('Label2'));
        $notebook->connect('switch-page', array($this,
'onSwitchNotebookPage'));
        $this->show_all();
    }
    function onSwitchNotebookPage(GtkNotebook $notebook) {
        echo 'switch' . "\r\n";
    }
} new Notebooktest(); Gtk::main(); ?> Regards/MfG, Christian Weiske


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