PHP-GTK Introduction and Application_PHP Tutorial

WBOY
Release: 2016-07-13 16:54:20
Original
782 people have browsed it

1. Introduction to PHP-GTK
1.1 PHP-GTK
PHP-GTK is an extension module of PHP, which allows programmers to write independent GUI programs that are executed on the client. This module does not allow GTK+ programs to be displayed in the browser. It was originally developed to write stand-alone GUI programs.
1.2 GTK
GTK was originally developed for GIMP, a GUI image processing software. GTK+ is a suite of tools from GIMP. GTK+ evolved from here until it is now central to Gnome (Gnome is a desktop environment). Later, GTK+ has also been promoted to BeOS and Win32, making it the best choice for PHP extension modules. It maintains PHP's cross-platform and can use PHP to develop window interface programs for Linux, BeOS, Windows and other platforms.
2. PHP-GTK Concepts
2.1 Preface
Next, I will teach you some conceptual things┅Because the concepts in this chapter are very important, so even if you don’t understand, you can still You have to understand it slowly, otherwise you will lose it in the future. Also, the following content is not recommended for readers without programming experience, because there are many concepts that can easily be confused. Also, I will use English for the following parts that should be used in English, so that everyone will not be overwhelmed when reading foreign documents. Come on!! If you don’t understand anything about this chapter, please look it up by yourself
PHP-GTK Manual: http://gtk.php.net/manual/en/
2.2 Widget(s)
Widget is the basic functions and forms in a GUI program. The most commonly used widgets are: label, button, window, frame and text box. All widgets come from an abstract basic class─GtkWidget. Every widget is a class
A widget has about five periods in its life:
1. Creation: declaring an object
2. Placement: placing it Adding it to a container
3. Signal Connection: receiving the signal and performing the action (the action it will perform)
4. Display: whether it is visible (whether it is viewable or not)
5. Destruction: closing of a program
2.3 Container(s)
Container is a widget that can contain other widgets. Most widgets are containers, such as GtkWindow, GtkTable and GtkBox. Other than this, containers are just like other widgets and can be placed in other containers. All containers come from one class─GtkContainer, which itself comes from the GtkWidget class. So container is also a type of widget.
2.4 Signal(s)
When the programmer makes an action in the program, the program needs to have an action to respond to the user's action. Signals allow programs to know when a user has taken an action and trigger appropriate responses.
For example, when the user clicks a button (GtkButton) that can open a new window, the program recognizes this request and opens a new window. This can be done via signal. When the button is pressed, the widget will send out a signal, and then the signal will trigger callbacks to generate a new window (GtkWindow).

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631755.htmlTechArticle1. Introduction to PHP-GTK 1.1 PHP-GTK PHP-GTK is an extension module of PHP, which allows programs to Designers write independent GUI programs that execute on the client. This mod is not allowed to be displayed on the browser...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template