Introducing WinBinder



IntroWinBinder (23K)


WinBinder is an open source extension to PHP, the script programming language. It allows PHP programmers to easily build native Windows applications, producing quick and rewarding results with minimum effort. Even short scripts with a few dozen lines can generate a useful program, thanks to the power and flexibility of PHP.


What is WinBinder? In Plain English Please!

WinBinder allows you to create GUI applications using PHP, or you can add a GUI-front end to an existing PHP script.

A GUI stands for Graphical User Interface and as a Windows user you are quite familiar with GUIs, whether you were aware of it or not. Essentially a GUI provides a visual interface (usually just called a "Window") for interacting with an application.

In a typical "Window" you will often find a wide variety of objects or "things". These objects or "things" are often called different names such as widgets, GUI controls, user controls, or simply controls.

During this tutorial we will refer to these objects as user controls. The following are examples of different user controls found in a typical GUI application or "Window".

GUI Application (Window):

Export_slide003 (33K)


User Controls (Inside a Window):

The above sample application contains a number of user controls, such as:

Push buttons,


Export_slide003 (14K)


Toolbar buttons,

Export_slide003 (14K)



and finally a Menu Bar with Menus.

Export_slide003 (14K)



That's Nice! What has it got to do with Creating Web-Pages?

In a single word -- NOTHING! WinBinder has nothing to do with creating web-pages, web-sites, or even web-applications.

At this stage you might be somewhat confused, and wondering what exactly you are doing here, and why you'd even care about WinBinder. WinBinder along with PHP allows you to create local applications -- that is applications that run on your machine and not through the Internet or a Browser.


Isn't that why we have C & C++, Java, Delphi, Python, C#? For Creating Applications ?

Yes -- you can use any of those languages to create applications. The big advantage of using WinBinder is that you can use your existing skills and knowledge in PHP and turn around and re-use it to create standalone applications that run directly on your computer.

Although PHP is great for creating simple, small scripts and utilities very quickly and easily, it tends to be somewhat limiting in its capabilities or flexibility due to the command line nature (ie: run from a DOS Window). By having the power to slap a GUI front-end onto your script you can instantly make it more friendly, flexible, and ultimately more useful and productive.


What about Full-Blown Applications? What if I want to Create a Real Application?

You can -- there is nothing stopping you from using WinBinder & PHP to create full-blown Windows Applications. WinBinder already comes with a number of sample applications which are described below.

"ToDo" Application:


Export_slide003 (14K)



The "ToDo" application allows you to create categorized lists of items that need to be completed like a task list. As you can see from the screenshot above, the interface has a wide variety of user controls including:

TreeView user control,


Export_slide003 (14K)



The TreeView control is a very useful and versatile component. It allows you to group items together, navigate complex structures, and provide a comfortable approach to sift through information. Clicking on the plus sign (+) will show you another level of groupings. You can have groups nested inside of other groups, just like in Windows explorer.

Grid user control,


Export_slide003 (14K)


Using the Grid control you can easily create a table with rows & columns to display information, in the same manner as a spreadsheet.

And of course you have the other standard controls such as:

Drop-down lists, for selecting options,


Export_slide003 (14K)


Text boxes for entering text,


Export_slide003 (14K)


As you can see, in addition to using the standard controls such as push buttons, text boxes, drop-down lists, you can also use more complex controls such as the Grid and TreeView controls.

Another application using WinBinder & PHP, called Layout Editor will allow you to visually design and develop screens for your applications. Essentially a RAD (Rapid Application Development) type environment for quickly developing GUI interfaces in WinBinder, for WinBinder applications.


WinBinder Layout Editor:

Export_slide003 (14K)


Wait a Second, I don't use Windows? What about Linux? Macintosh?

Well, unfortunately WinBinder cannot help you in this instance. WinBinder is designed for use on Windows computers only. This includes Windows 95 / 98 / ME / 2000 / XP (and NT 4.0). As you will learn throughout this tutorial, WinBinder is based on using the Windows API -- essentially it means using the controls and code that comes built-in with Windows.

If you are using an operating system other than Windows, then it will not have the controls and code necessary for WinBinder to run. Due to the internal nature of WinBinder, and it's sole reliance upon the Windows API, it is not practical or even possible to port WinBinder to other non-Windows operating systems.


Okay Great, I'm Hooked -- Now What do I do?

Great -- read on. The next section will deal with downloading WinBinder, installation, setup, & configuring your PHP text editor or IDE to use WinBinder.