GTK + Study Notes

Source: Internet
Author: User
Tags image processing library
GTK + Study Notes-general Linux technology-Linux programming and kernel information. The following is a detailed description. Linux was born in 1991 and is the kernel of an operating system written by LinusTorvalds in Finland.
In 1994, linux1.0 was officially released.
Today, linux is a powerful 32-bit operating system.
Linux: GNU operating system. Follow the GPL protocol.
Currently, linux is mostly used on servers.

Terms:
GNU: network object simulation environment.
GUI: Graphics User Interface, graphical User Interface.
KDE: K Desktop Environment. It is based on the Qt library. The Qt library is a C ++ class library on the exaggerated platform.
Gnome: GNU Network Object Model Environment, GNU Network Object simulation Environment.
GIMP: GNU Image Processing Program
GDK: GIMP Drawing Kit, which encapsulates the underlying functions of the access window.
Gdk-pixbuf: client image processing Library

GTK: GIMP Toolkit, used to create a graphical user interface. Follow LGPL. It was initially used to develop GIMP.
GTK is built on the basis of GMP and pdk-pixbuf.
GTK is essentially an object-oriented application interface (API) written in C language.

GTK + is the graph building set of GTK.

To program GTK +/GNOME, first install the GTK +/GNOME Library
GTK + Official Website: http://www.gtk.org/
GNOME Official Website: http://www.gnome.org/

After learning about the basic terms, start to learn GTK + programming:
The GTK + program can be written in any linux editor. I like to use the gedit text editor. Select GCC for compilation.

I have read a lot of articles, generally starting with the simplest program below:
Create a window:

Code:
# Include /* Each GTK is called */

Int main (int argc, char * argv [])/*
The function sets the default video (visual) and color ing mode (color map ),
Then, the gdk_init (gint * argc, gchar *** argv) function is called. Each GTK has */
{
GtkWidget * window;

Gtk_init (& argc, & argv );

Window = gtk_window_new (GTK_WINDOW_TOPLEVEL );
/* Use the window manager to modify and place the window */
Gtk_widget_show (window);/* display window */

Gtk_main ();/* When the program runs here, GTK will "fall asleep" and wait for X events (such as button or keyboard Press), timeout (timeouts), or file IO notifications */

Return 0;
}

Save the above Code as base. c.

Compile with GCC on the terminal:
Gcc base. c-o base 'pkg-config -- cflags -- libs gtk +-2.0'
Note that 'is the ~ on the keyboard TAB ~, Rather than '. If the input is incorrect, compilation will fail.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.