PHP-GTK was originally conceived by Andrei Zmievski, who is also actively involved in the development of PHP and the Zend Engine. The idea was received well by the PHP community, and more people started to get involved with the project. James Moore and Steph Fox were among the first to join in, contributing a great deal to PHP-GTK through their documentation efforts, and Frank Kromann - also from the PHP development team - supplied Windows binaries for the project. The first version of PHP-GTK was released in March 2001. More people began to get involved, and several extensions were contributed introducing new widgets, such as Scintilla and . PHP-GTK 1.0 was released in October 2003 alongside several extensions — including a wrapper for libglade, which allowed the cross-platformGladeUI builder to be used in creating PHP-GTK applications.
Present
Zmievski and Fox are still working on the project, with Fox now maintaining PHP-GTK for Windows. The planned next major release, PHP-GTK 2 fully utilizes PHP 5's powerfulobject model support, and brings the improved portability of GTK 2.6 as well as its new set of widgets. The project also has support for GtkSourceView, which provides a source code editor widget. Around half the classes have been fully documented. Scott Mattocks, an active member of the PHP-GTK documentation group, has also written a book on the subject of PHP-GTK programming. The project is only compatible with GTK 2, not version 3. WxPHP exists as an alternative to develop GTK PHP applications.
Example
function pressed $window = new GtkWindow; $button = new GtkButton; $button1 = new GtkButton; $window->set_title; $window->connect_simple; $button->connect_simple; $button1->connect_simple; $window->add; $window->show_all; Gtk::main; ?>
The sample PHP-GTK 2 program instantiates a GtkWindow widget with the title "Hello World!", containing a GtkButton labelled "Click Me." When the button is pressed, the message "Hello again - The button was pressed!" is displayed on the console via the callbackpressed.
Deployment
Several tools have sprung up that assist the simple deployment of PHP-GTK applications. PHP compilers such as PriadoBlender and Roadsend PHP enable the compilation of applications written in PHP-GTK to a standalone binary executable. Alan Knowles' PECL package, , also allows compilation of PHP into bytecode to hide the source code.