GTK+ -- from knowing nothing to knowing something (1)

来源:互联网 发布:python的helloworld 编辑:程序博客网 时间:2024/06/06 05:11

What's GTK+ and what's it for? 

(the following comes from the official website - www.gtk.org)

GTK+ was initially developed for and used by the GIMP, the GNU Image Manipulation Program. Therefore, it is named "The GIMP Toolkit", so that the origins of the project are remembered.

GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites.

GTK+ is free software and part of the GNU Project. However, the licensing terms for GTK+, the GNU LGPL, allow it to be used by all developers, including those developing proprietary software, without any license fees or royalties.

GTK+ is based on three libraries developed by the GTK+ team:

  • GLib is the low-level core library that forms the basis of GTK+ and GNOME. It provides data structure handling for C, portability wrappers, and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system.
  • Pango is a library for layout and rendering of text, with an emphasis on internationalization. It forms the core of text and font handling for GTK+-2.0.
  • The ATK library provides a set of interfaces for accessibility. By supporting the ATK interfaces, an application or toolkit can be used with such tools as screen readers, magnifiers, and alternative input devices.

GTK+ has been designed from the ground up to support a range of languages, not only C/C++. Using GTK+ from languages such as Perl and Python (especially in combination with the Glade GUI builder) provides an effective method of rapid application development.

(end of quotation)

Keywords that should be remembered: multi-platform, internationalization, interface, toolkit. This is GTK+. You use it to build up interface that can be run on various platforms with different languages supported.

How to compile it and how to compile the program using it?

To be honest, I didn't pay much attention to this. Since the project was in a hurry, and most linux systems are already equipped with it, I just took it and used it. If any problems are encountered, the best place to find the solution is still - www.gtk.org . A simple tutorial and an installation guide are available there.

Getting Started

Most of such introductions start with an infamous "Hello World" code. Well, I don't want to be an exception here, at least not this time. Let me see, how about talking it in (2)?