We have been creating web-applications using PHP since it came into existence, now we can also develop Desktop or Stand alone Applications with PHP-GTK. Desktop Applications are one which does not need either a Web Server like IIS, Apache, PWS etc. or a web browser for their execution. One of the reasons why Java is so popular is because it can be used to build applications, web pages, applets and beans that can run on several platforms including Windows, Linux and Solaris. Java runs a virtual machine called JVM, and code is compiled into an intermediate format known as Java byte code, which is platform independent. When that particular piece of code is executed within the JVM, the JVM optimizes the code for the particular platform on which it is running as it is being compiled.
Microsoft's latest technology, .NET follows the same principles. Code is compiled into Microsoft Intermediate Language (MSIL) and is then executed within the .NET framework as an application domain. Microsoft is hoping to standardize C# and MSIL so that .NET code can run cross platform.
So what has all of this got to do with PHP-GTK? Well, both Java and .NET can be used to build windowed applications and web pages. Thanks to PHP-GTK, we can now build cross platform windowed applications with PHP as well.
With OSInet having a large part of its business with suppliers and customers within the EU at large, I often find myself having to check the validity of the VAT information for third parties, and the EU VIES database comes in handy.
VIES client UI done in PHP-GTK However, although I had been discussing remote access using XML-RPC or SOAP as early at 2004 with the database administrators, the UI had remained web 1.0-only until quite recently (apparently march 2007), when an AXIS SOAP service went online, just as I had suggested three years ago. So I figured I really couldn't let the occasion pass, and did a PHP-GTK client to VIES, which happens to be my first production SOAP application in PHP-GTK, previous ones having always been done in Pascal using Delphi or Kylix.
Let's see how this can be done...
This function provides an easy way to empty a GtkWindow/GtkContainer. I use it when i need to refresh a part of my app by replacing some widgets with others. It can destroy or preserve the child widgets depending on your needs.
When creating a soft, you'll often want to have a menu like in the majority of graphical softs. It's often clear in your mind but require more code than you want to do simple things using a plain GtkMenu. So here's a class to help you to quickly design such menus and will also allow you to display nice icon in your menus.
One of the hardest parts about getting started with PHP-GTK is understanding how to properly layout the user interface. It can be very frustrating to finally get an application laid out just right, only to see it horribly disfigured when the user expands or shrinks the window. Part III of this series focuses on how to manage the relationships between parents and children in such a way that the application behaves well no matter what the user does to the window.
Part I of this PHP-GTK series looked at what PHP-GTK is and why you might want to use it. The next installment, "Hello PHP-GTK 2", gets down to business with the requisite "Hello World" application. This article attempts to go a little deeper than just showing the code to get it working. Instead the article talks about how each line of the application interacts with the others, giving a better picture of the process of building a PHP-GTK application.
PHP-GTK is the Cinderella of the PHP world. Most people dismiss it as an impractical curiosity trying to fit in where it doesn't belong. It is a desktop application extension stuck in a web developer's language. After all, most PHP developers make their money building websites. To all of these "Wicked Step-Sisters" I say, don't be so quick to judge. Take a moment to look beneath the surface and glimpse at PHP-GTK's true potential.
For PHP-GTK 2, I showed off a couple of apps that I quickly wrote a few days before and that make use of Yahoo! developer APIs. The first one lets you pick two airports and calculates the distance between them as well as showing the local maps and weather info. The second one uses Flickr API to display a continuous grid of latest images from flickr.com.
Table of Contents
- History of Winbinder
- Why Winbinder?
- Code Basics
- Windows and Controls
- Winbinder Framework
- Distributing your Code
- Design Considerations
For several years, PHP has dominated on the Web, becoming the leading Web scripting language. However, PHP is not only for Web use; it is a general-purpose language that can be used to create desktop applications using GTK extensions. This talk examines some of the more popular applications created using PHP-GTK, as well as providing resources for more information on creating PHP-GTK applications.








