PHP-GTK

Last updated
PHP-GTK
Developer(s) Andrei Zmievski
Initial releaseMarch 2001;22 years ago (2001-03)
Stable release
2.0.1 / January 15, 2015;8 years ago (2015-01-15)
Operating system Cross-platform
Type Language binding
License GNU Lesser General Public License
Website gtk.php.net

PHP-GTK is a set of language bindings for the programming language PHP which allow GTK graphical user interface (GUI) applications to be written in PHP. PHP-GTK provides an object-oriented programming interface to GTK classes and functions. PHP-GTK partly supports GTK2, but GTK3 is unsupported. [1]

Contents

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.[ clarification needed ]

The first version of PHP-GTK was released in March 2001. More people began to get involved, and several extensions were contributed introducing new GUI 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 Interface Designer UI builder to be used in creating PHP-GTK applications.

Zmievski and Fox continued to work on the project, with Fox maintaining PHP-GTK for Windows.[ clarification needed ]

In 2008 PHP-GTK 2.0.0 was released to fully use PHP 5.2's powerful object model support, and to bring the improved portability of GTK 2.6, and its new set of widgets. The project also has support for GtkSourceView, which provides a source code editor widget. Around half the classes have been fully documented. Scott Mattocks, a member of the PHP-GTK documentation group, has also written a book on the subject of PHP-GTK programming. [2]

In 2015 PHP-GTK 2.0.1 was released to be compatible with PHP 5.5 and GTK 2.24. [3]

The project is compatible with only GTK 2, not version 3.

WxPHP (WxWidgets for PHP) exists as an alternative to develop GTK PHP applications.

Example

Hello World PHP-GTK Hello World PHP-GTK.png
Hello World PHP-GTK
<?phpfunctionpressed(){echo"Hello again - The button was pressed!\n";}$window=newGtkWindow();$button=newGtkButton('Click');$button1=newGtkButton('Click');$window->set_title('Hello World!');$window->connect_simple('destroy',array('Gtk','main_quit'));$button->connect_simple('clicked','pressed');$button1->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 PHP (Currently only compatible with PHP-GTK 1, while latest snapshot includes PHP-GTK 2) enable compiling applications written in PHP-GTK to a standalone binary executable. Alan Knowles' PHP Extension and Application Repository (PEAR) package, bcompiler, also allows compiling PHP into bytecode to hide the source code.

See also

Related Research Articles

<span class="mw-page-title-main">Qt (software)</span> Object-oriented framework for software development

Qt is cross-platform software for creating graphical user interfaces as well as cross-platform applications that run on various software and hardware platforms such as Linux, Windows, macOS, Android or embedded systems with little or no change in the underlying codebase while still being a native application with native capabilities and speed.

wxWidgets Widget toolkit

wxWidgets is a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. wxWidgets enables a program's GUI code to compile and run on several computer platforms with minimal or no code changes. A wide choice of compilers and other tools to use with wxWidgets facilitates development of sophisticated applications. wxWidgets supports a comprehensive range of popular operating systems and graphical libraries, both proprietary and free, and is widely deployed in prominent organizations.

<span class="mw-page-title-main">FLTK</span>

Fast Light Toolkit is a cross-platform widget library for graphical user interfaces (GUIs), developed by Bill Spitzak and others. Made to accommodate 3D graphics programming, it has an interface to OpenGL, but it is also suitable for general GUI programming.

<span class="mw-page-title-main">Graphical widget</span> Element of interaction in a graphical user interface

A graphical widget in a graphical user interface is an element of interaction, such as a button or a scroll bar. Controls are software components that a computer user interacts with through direct manipulation to read or edit information about an application. User interface libraries such as Windows Presentation Foundation, Qt, GTK, and Cocoa, contain a collection of controls and the logic to render these.

<span class="mw-page-title-main">PyQt</span> Python GUI library

PyQt is a Python binding of the cross-platform GUI toolkit Qt, implemented as a Python plug-in. PyQt is free software developed by the British firm Riverbank Computing. It is available under similar terms to Qt versions older than 4.5; this means a variety of licenses including GNU General Public License (GPL) and commercial license, but not the GNU Lesser General Public License (LGPL). PyQt supports Microsoft Windows as well as various kinds of UNIX, including Linux and MacOS.

<span class="mw-page-title-main">PyGTK</span> Set of Python wrappers for the GTK graphical user interface library

PyGTK is a set of Python wrappers for the GTK graphical user interface library. PyGTK is free software and licensed under the LGPL. It is analogous to PyQt/PySide and wxPython, the Python wrappers for Qt and wxWidgets, respectively. Its original author is GNOME developer James Henstridge. There are six people in the core development team, with various other people who have submitted patches and bug reports. PyGTK has been selected as the environment of choice for applications running on One Laptop Per Child systems.

<span class="mw-page-title-main">Fox toolkit</span>

The FOX toolkit is an open-source, cross-platform widget toolkit, i.e. a library of basic elements for building a graphical user interface (GUI). FOX stands for Free Objects for X.

wxPython Python wrapper for wxWidgets

wxPython is a wrapper for the cross-platform GUI API wxWidgets for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extension module.

<span class="mw-page-title-main">Graphical user interface builder</span> Software development tool

A graphical user interface builder, also known as GUI designer or sometimes RAD IDE, is a software development tool that simplifies the creation of GUIs by allowing the designer to arrange graphical control elements using a drag-and-drop WYSIWYG editor. Without a GUI builder, a GUI must be built by manually specifying each widget's parameters in the source code, with no visual feedback until the program is run. Such tools are usually called the term RAD IDE.

gtkmm is the official C++ interface for the popular GUI library GTK. gtkmm is free software distributed under the GNU Lesser General Public License (LGPL).

Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk GUI toolkit, and is Python's de facto standard GUI. Tkinter is included with standard Linux, Microsoft Windows and macOS installs of Python.

fpGUI Graphical user interface toolkit in Object Pascal

fpGUI, the Free Pascal GUI toolkit, is a cross-platform graphical user interface toolkit developed by Graeme Geldenhuys. fpGUI is open source and free software, licensed under a Modified LGPL license. The toolkit has been implemented using the Free Pascal compiler, meaning it is written in the Object Pascal language.

Clutter is a discontinued GObject-based graphics library for creating hardware-accelerated user interfaces. Clutter is an OpenGL-based 'interactive canvas' library and does not contain any graphical control elements. It relies upon OpenGL (1.4+) or OpenGL ES for rendering,. It also supports media playback using GStreamer and 2D graphics rendering using Cairo.

The GTK-server project aims to bring graphical user interface (GUI) programming to any interpreted language using the GNU Image Manipulation Program (GIMP) ToolKit (GTK) or XForms. It releases free and open-source software under the GNU General Public License.

<span class="mw-page-title-main">Qt Creator</span> QT development environment

Qt Creator is a cross-platform C++, JavaScript, Python and QML integrated development environment (IDE) which simplifies GUI application development. It is part of the SDK for the Qt GUI application development framework and uses the Qt API, which encapsulates host OS GUI function calls. It includes a visual debugger and an integrated WYSIWYG GUI layout and forms designer. The editor has features such as syntax highlighting and autocompletion. Qt Creator uses the C++ compiler from the GNU Compiler Collection on Linux. On Windows it can use MinGW or MSVC with the default install and can also use Microsoft Console Debugger when compiled from source code. Clang is also supported.

<span class="mw-page-title-main">GTK</span> Free and open-source cross-platform widget toolkit for creating graphical user interfaces

GTK is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprietary software to use it. It is one of the most popular toolkits for the Wayland and X11 windowing systems.

<span class="mw-page-title-main">PySide</span>

PySide is a Python binding of the cross-platform GUI toolkit Qt developed by The Qt Company, as part of the Qt for Python project. It is one of the alternatives to the standard library package Tkinter. Like Qt, PySide is free software. PySide supports Linux/X11, macOS, and Microsoft Windows. The project can also be cross compiled to embedded systems like Raspberry Pi, and Android devices.

Wt is an open-source widget-centric web framework for the C++ programming language. It has an API resembling that of Qt framework, also using a widget-tree and an event-driven signal/slot system.

wxPHP is an extension the programming language PHP that wraps the wxWidgets library, which allows writing cross-platform software desktop applications that make use of the native graphical components available to the different platforms. It supports the three major operating systems: Windows, Linux, and macOS by using PHP. Applications are written in PHP, which is an interpreted language. Thus, it needs no intermediate compiling step to run an application, if the PHP interpreter has the extension available.

References

  1. "Language Bindings". Archived from the original on 2011-07-13. Retrieved 2015-01-28.
  2. Mattocks, Scott (18 April 2006). Pro PHP-GTK. ISBN   1-59059-613-7.
  3. "downloads?" . Retrieved 2024-01-08.