Here is a simple example with a window and a button. This is a modified version of the hello.php example
found in the test directory of the PHP-GTK source. Here is the example code:
<?php
// verify extension
if (!extension_loaded('gtk')) {
dl('php_gtk.'.PHP_SHLIB_SUFFIX);
} else {
exit("PHP-GTK extension did not load.\n");
}
// event function
function buttonClick($window)
{
echo "Hello PHP-GTK World!\n";
}