Opentopia Directory Encyclopedia Tools

PHP-GTK

Encyclopedia : P : PH : PHP : PHP-GTK


PHP-GTK is an extension for the PHP programming language that implements language bindings for GTK+. It provides an object-oriented interface to GTK+ classes and functions and greatly simplifies writing client-side cross-platform GUI applications.

Significant uses of PHP-GTK include:

History

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 [GtkHTML]. PHP-GTK 1.0 was released in October 2003 alongside several extensions - including a wrapper for libglade, which allowed the cross-platform [Glade] UI builder to be used in creating PHP-GTK applications.

Present

PHP-GTK was quickly adopted by the PHP community. Several applications were developed, and a small job market even emerged. Andrei and Steph are still working hard on the project, with Steph now maintaining PHP-GTK for Windows.

Development is in full swing for the next major version of PHP-GTK. PHP-GTK 2 fully utilizes PHP 5's powerful object model support, and brings the improved portability of GTK 2.6 as well as its new set of widgets. The project also has some new extensions such as GtkSourceView, which provides a rich source editor widget, alongside some of the old favourites.

Documentation for PHP-GTK 2 is filling out rapidly. Several articles and tutorials have been written on the topic, and 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.

Example

Screenshot of the example
Screenshot of the example



function pressed()

$window = new GtkWindow(); $button = new GtkButton('Click Me');

$window->set_title('Hello World!'); $window->connect_simple('destroy', array('Gtk', 'main_quit')); $button->connect_simple('clicked', 'pressed');

$window->add($button); $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 callback pressed.

Deployment

Several tools have sprung up that assist the simple deployment of PHP-GTK applications. PHP compilers such as [PriadoBlender] and [Roadsend] enable the compilation of applications written in PHP-GTK to a standalone binary executable. Alan Knowles' PECL package, [bcompiler], also allows compilation of PHP into bytecode to protect the source.

[Gnope] is a tool providing a straightforward means of deployment under Windows. It allows transparent installation of PHP-GTK 2, and applications written using it, through Gnope's own PEAR-compatible channel.

Future

Although already usable to a large extent, PHP-GTK 2 is undergoing heavy development in anticipation of an alpha release. Current priorities include API completeness, methods to create new custom widgets and performance optimizations.

External links

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.

Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: