Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

PHP-GTK

From Wikipedia, the free encyclopedia
PHP library for GTK+ GUI applications
PHP-GTK
Developer(s)Andrei Zmievski
Initial releaseMarch 2001; 24 years ago (2001-03)
Stable release
2.0.1 / January 15, 2015; 10 years ago (2015-01-15)
Operating systemCross-platform
TypeLanguage binding
LicenseGNU Lesser General Public License
Websitegtk.php.net
Main article:List of language bindings for GTK

PHP-GTK is a set oflanguage bindings for theprogramming languagePHP which allowGTKgraphical user interface (GUI) applications to be written in PHP. PHP-GTK provides anobject-oriented programming interface to GTK classes and functions. PHP-GTK partly supports GTK2, but GTK3 is unsupported.[1]

History

[edit]

PHP-GTK was originally conceived by Andrei Zmievski, who is also actively involved in the development of PHP and theZend 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, suppliedWindows 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 newGUI widgets, such asScintilla andGtkHTML. PHP-GTK 1.0 was released in October 2003 alongside several extensions, including a wrapper for libglade, which allowed the cross-platformGlade 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 forGtkSourceView, which provides asource 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 onlyGTK 2, not version 3.

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

Example

[edit]
Hello World PHP-GTK
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 aGtkWindow widget with the title "Hello World!", containing aGtkButton labelled "Click Me." When the button is pressed, the message "Hello again - The button was pressed!" is displayed on the console via thecallbackpressed.

Deployment

[edit]

Several tools have sprung up that assist the simple deployment of PHP-GTK applications. PHP compilers such as PriadoBlender andRoadsend 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

[edit]

References

[edit]
  1. ^"Language Bindings". Archived fromthe original on 2011-07-13. Retrieved2015-01-28.
  2. ^Mattocks, Scott (18 April 2006).Pro PHP-GTK. Apress.ISBN 1-59059-613-7.
  3. ^"downloads?". Retrieved2024-01-08.

External links

[edit]
Platform
GTK
freedesktop.org
(shared)
Development
GUI designer,RAD
IDEs
GNOME
Cinnamon
Xfce
LXDE
Graphical shells
3rd-party
applications
Office
Education
Graphics
Internet
Audio
Video
Utilities
People
Resources
Implementations
Web frameworks
Testing
ORMs
IDEs
Widget toolkit
Retrieved from "https://en.wikipedia.org/w/index.php?title=PHP-GTK&oldid=1258609389"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp