" Foo True True Bar '; function foo() { echo "button was clicked\n"; } class handler { function doBar() { echo "another button was clicked\n"; } } $builder = new GtkBuilder(); $builder->add_from_string($xml); $builder->add_from_file(dirname(__FILE__) . '/notebook.xml'); $class = new handler(); $builder->connect_signals(array('handler' => array($class, 'doBar'))); // could also use $builder->connect_signals_instance if they were all in a single class $builder->get_object('vbox')->add($builder->get_object('mynotebook')); $objects = $builder->get_objects(); echo count($objects), " objects were created by GtkBuilder\n"; $builder->set_translation_domain('myapp'); echo $builder->get_translation_domain(), "\n"; var_dump($builder->get_type_from_name('GtkButton')); $window = $builder->get_object('window1'); $window->show_all(); Gtk::main(); ?>