<?php// Step 1 - Ensure php-gtk2 has been initialized, else everything else will fail.if (!class_exists('gtk')) { die('ERROR!!!!!!! PHP-GTK2 has not been configured in your system.' . "\r\n");}class test1 extends GtkWindow{ function __construct() { parent::__construct(); $this->connect_simple('destroy',array('Gtk','main_quit')); $this->set_title('My Test Application'); $vbox = new GtkVBox(); $this->add($vbox); $label = new GtkLabel("I can haz cheezburger, plz?"); $vbox->pack_start($label); $button = new GtkButton("Click me, Dude!"); $button->connect_simple('clicked',array($this,'on_click'), $label); $vbox->pack_start($button); $this->show_all(); } function on_click($label) { $label->set_text("You clicked me, dude!"); }}new test1(); Gtk::main();?>