Everyone thought php is just for the web? Wrong. With GTK you can develop desktop applications using PHP! Is'nt that absolutely awesome?
PHP-GTK is an extension for PHP programming language that implements language bindings for GTK+ toolkit. It provides an object-oriented interface to GTK+ classes and functions and greatly simplifies writing client side cross-platform GUI applications.
Download php gtk documentation here:
[http://gtk.php.net/download-docs.php]
Download php-gtk gere:
[http://gtk.php.net/download.php]
Home ofphp gtk:
[http://gtk.php.net/]
Here is a detailed article about how to begin with php gtk application developments:
[http://www.devx.com/opensource/Article/21235/0/page/1]
It is very easy and everything just the same as regular php coding for web pages after you install the GTK. Even it opens and closes the same way other PHP code does. The first line of code is always <?php, and the last line is ?>.
One extra thing you have to do is you must detect the operating system (OS). As such, the following code snippet is necessary for all PHP-GTK applications:
| Quote: |
<?php
if (!class_exists('gtk')) {
dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so'));
}
/*Now, create the window widget as a variable.*/
$window = &new GtkWindow();
/*Next, create a title for this new window widget.*/
$window->set_title("PHP Window Number 1");
/*Then you will set the widget window to the center of the screen.*/
$window->set_position(GTK_WIN_POS_CENTER);
/*This statement is also necessary in all PHP-GTK applications that have graphics on the screen.
This shows all the parent widgets and their children.*/
$window->show_all();
/* Run the program from top to bottom. */
Gtk::main();
?> |
This creates a simple window widget. Try it out. Simply paste the code into Notepad or a similar text editor and save the file as phpwindow1.php. Cool nah!
_________________
Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.