Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 11c5630b2c8f00f64861e0dac51a202a > files > 56

php-gtk2-2.0.1-12mdv2010.0.i586.rpm

<?php
/**
*   FIXED by Andrei (?) on 2005-10-01
*   Problem reason: GPointer wasn't implemented
*
*   Problem: When the switch-page signal is emitted,
*   a gpointer is needed - but that's not defined
*/
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";
    }
}

if (!($argc > 1 && $argv[1] == 'debug')) {
    error_reporting(E_ERROR);
}
new Notebooktest();
echo "ok\n";
gtk::main();

?>