Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
PHP-GTK
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|PHP library for GTK+ GUI applications}} {{Infobox software | name = PHP-GTK | logo = Php-gtk.png | caption = PHP-GTK Logo | developer = Andrei Zmievski | released = {{Start date and age|2001|03}} | latest release version = 2.0.1 | latest release date = {{Start date and age|2015|01|15}} | latest preview version = | latest preview date = | operating_system = [[Cross-platform]] | genre = [[Language binding]] | license = [[GNU Lesser General Public License]] | website = {{URL|gtk.php.net}} }} {{Main|List of language bindings for GTK}} '''PHP-GTK''' is a set of [[language binding]]s 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.<ref>{{cite web |url=http://www.gtk.org/language-bindings.php|title=Language Bindings |access-date=2015-01-28 |url-status=dead |archive-url=https://web.archive.org/web/20110713100421/http://www.gtk.org/language-bindings.php |archive-date=2011-07-13}}</ref> == 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 [[Microsoft Windows|Windows]] binaries for the project.{{clarify|date=September 2014}} 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 widget]]s, such as [[Scintilla (software)|Scintilla]] and [http://freshmeat.net/projects/libgtkhtml/ 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.{{clarify|date=September 2014}} 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.<ref>{{cite book|title=Pro PHP-GTK|first=Scott|last=Mattocks|date=18 April 2006 |publisher=Apress |isbn=1-59059-613-7}}</ref> In 2015 PHP-GTK 2.0.1 was released to be compatible with PHP 5.5 and GTK 2.24.<ref>{{cite web|title=downloads?|url=http://gtk.php.net/download.php?language=en-US|access-date=2024-01-08}}</ref> 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 == [[File:Hello World PHP-GTK.png|Hello World PHP-GTK|right]] <syntaxhighlight lang="php"> <?php function pressed() { echo "Hello again - The button was pressed!\n"; } $window = new GtkWindow(); $button = new GtkButton('Click'); $button1 = new GtkButton('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(); </syntaxhighlight> The sample PHP-GTK 2 program instantiates a <code>GtkWindow</code> widget with the title "Hello World!", containing a <code>GtkButton</code> labelled "Click Me." When the button is pressed, the message "Hello again - The button was pressed!" is displayed on the console via the [[Callback (computer programming)|callback]] <code>pressed</code>. == 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, [http://pecl.php.net/package/bcompiler bcompiler], also allows compiling PHP into bytecode to hide the source code. == See also == {{Portal|Free and open-source software}} * [[wxPHP]] ==References== {{Reflist}} ==External links== *{{Official website|gtk.php.net}} *[http://php-gtk.eu/ Community site] {{Webarchive|url=https://web.archive.org/web/20120603070733/http://php-gtk.eu/ |date=2012-06-03}} *[https://github.com/php/php-gtk-src Github repository] *[https://github.com/subabrain/RPGET RPGETv6 Beta Tool to encrypt PHPGTK Sourcecode] {{GTK}} {{PHP}} [[Category:PHP software]] [[Category:GTK language bindings]] [[Category:Widget toolkits]] [[Category:Discontinued software]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Clarify
(
edit
)
Template:GTK
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Main
(
edit
)
Template:Main other
(
edit
)
Template:Official website
(
edit
)
Template:PHP
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Template other
(
edit
)
Template:Webarchive
(
edit
)