GTK + Interface Design

Source: Internet
Author: User
Tags cairo gtk

GTK + Interface Design

First look at a routine:
------------------------------
# Include <GTK/GTK. h> <br/> int main (INT argc, char * argv []) {<br/> gtkwidget * window; <br/>/* initialize GTK + and all of its supporting libraries. */<br/> gtk_init (& argc, & argv); <br/>/* Create a new window, give it a title and display it to the user. */<br/> window = gtk_window_new (gtk_window_toplevel); <br/> gtk_window_set_title (gtk_window (window), "Hello GTK"); <br/> gtk_widget_show (window ); <br/>/* hand control over to the main loop. */<br/> gtk_main (); <br/> return 0; <br/>}
------------------------------
Can be saved as try. c

Compilation process:
1) under the command line
Input:
PKG-config -- cflags GTK ++-2.0
Get:
-MMS-bitfields-ic:/GTK/include/gtk-2.0-ic:/GTK/lib/gtk-2.0/include-ic:/GTK/include/atk-1.0-ic: /GTK/include/Cairo-ic:/GTK/include/pango-1.0-ic:/GTK/include/glib-2.0-ic: /GTK/lib/glib-2.0/include-ic:/GTK/include/libpng12

Input:
PKG-config-libs GTK +-2.0
Get:
-LC:/GTK/lib-lgtk-win32-2.0-lgdk-win32-2.0-latk-1.0-lgio-2.0-lgdk_pixbuf-2.0-lpangowin32-1.0-lgdi32-lpangocairo-1.0-lpango-1.0-lcairo-lgobject-2.0-lgmodule-2.0-lglib-2.0-lintl

Both sections are the library paths required for GCC to compile try. C.

2) Compile with GCC
The command is as follows:
Gcc-o try. c-MMS-bitfields-ic:/GTK/include/gtk-2.0-ic:/GTK/lib/gtk-2.0/include-ic:/GTK/include/atk-1.0-ic: /GTK/include/Cairo-ic:/GTK/include/pango-1.0-ic:/GTK/include/glib-2.0-ic: /GTK/lib/glib-2.0/include-ic:/GTK/include/libpng12-LC: /GTK/lib-lgtk-win32-2.0-lgdk-win32-2.0-latk-1.0-lgio-2.0-lgdk_pixbuf-2.0-lpangowin32-1.0-lgdi32-lpangocairo-1.0-lpango-1.0-lcairo-lgobject-2.0-lgmodule-2.0-lglib-2.0-lintl

Note: gcc-o try. C is followed by the two library paths obtained earlier.

Run successfully and generate try.exe
Run the following command:

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.