What is PHP-GTK?
GTK is a library to develop PHP and created by Andrei Ziminevski, you want to see him? There are some varieties about that, Scintilla, GtkHTML, etc.
According to some of us, Java, C++ or C# is better to use than PHP-GTK. But If the coder who knows how to code on PHP use it, PHP-GTK should be very simple to code. That's why is OOP kind of PHP 5.
Installing PHP-GTK for Windows
Had you set any plugin up before, you shall say that, installing PHP-GTK plugin is so hard, but actually is not'cuz you have to know something about that. First go this site: gtk.php.net or here and download gtk library. After that open the .rar or .zip file you've just downloaded.
Download gtk library: gtk.php.net |
After this, open the winnt folder and copy the php.ini file, paste to php4 folder. And finish! You have finally finished the installing right now!
This one is for windows installation. If you want to install this package other system (Linux, MacOS something else), you can visit this official page.
The First GTK Project!
As we know, when the first project created, just done "hello world!". What we're gonna do is like that :) For this we need to php code and GTK library. that's it!
helloworld! MyFirstProject.php file
function clearThis() { Gtk::main_quit(); } $window = new GtkWindow(); $window->connect('destroy','clearThis'); $window->set_border_width('50'); //Alert's width set as 50px. $label = new GtkLabel("Hello World"); //Written Text sets here. $window->add($label); $window->show_all(); Gtk::main();It is time to work the project. First open your windows command screen and follow this directory: c:\php4\php c:\php4\test\MyFirstProject
Output |
See you guys next article!