1 #!/usr/bin/php -c/etc/php/php-gtk.ini
3 //GTK Hello world! by Harvie 2oo9
5 $app = new HelloWorld();
13 function __construct() {
14 $this->builder
= $builder = new GtkBuilder();
16 $builder->add_from_file('hello.ui');
17 $builder->connect_signals_instance($this);
20 $objects = $builder->get_objects();
21 echo count($objects), " objects were created by GtkBuilder\n";
23 $builder->set_translation_domain('myapp');
24 echo $builder->get_translation_domain(), "\n";
26 var_dump($builder->get_type_from_name('GtkButton'));
29 foreach(array('window1','entry1','button1') as $widget) {
30 $this->widgets
[$widget] = $builder->get_object($widget);
32 $this->widgets
['window1']->show_all();
36 function on_button1_clicked() {
37 $this->widgets
['button1']->set_label($this->widgets
['entry1']->get_text());
38 echo( $this->widgets
['entry1']->get_text()."\n" );
41 function on_window1_destroy(){
This page took 1.428195 seconds and 4 git commands to generate.