含有章节索引的中文 文章模板
::-- ehu4ever [DateTime(2005-08-07T05:40:51Z)] TableOfContents
1. PyGTK 2.0 Tutorial 中文编译
原作者:John Finlay
Version 2.4
April 13, 2005
1.1. 绪论
PyGTK 2.0 是一个系列的Python模块,它提供了一个使用 GTK+ 2.X 的接口。在本篇文档的其它部分中,PyGTK是指PyGTK的2.X版本,GTK 和 GTK+ 是指GTK+的2.X 版本。Python的门户是[http://www.pygtk.org www.pygtk.org]。PyGTK的主要作者是
James Henstridge [mailto:[email protected] [email protected] ]
who is assisted by the developers listed in the AUTHORS file in the PyGTK distribution and the PyGTK community.
Python is an extensible, object-oriented interpreted programming language which is provided with a rich set of modules providing access to a large number of operating system services, internet services (such as HTML, XML, FTP, etc.), graphics (including OpenGL, TK, etc.), string handling functions, mail services (IMAP, SMTP, POP3, etc.), multimedia (audio, JPEG) and cryptographic services. In addition there are many other modules available from third parties providing many other services. Python is licensed under terms similar to the LGPL license and is available for Linux, Unix , Windows and Macintosh operating systems. More information on Python is available at www.python.org . The primary Author of Python is:
Guido van Rossum [mailto:[email protected] [email protected] ]
GTK (GIMP Toolkit) is a library for creating graphical user interfaces. It is licensed using the LGPL license, so you can develop open software, free software, or even commercial non-free software using GTK without having to spend anything for licenses or royalties.
It's called the GIMP toolkit because it was originally written for developing the GNU Image Manipulation Program (GIMP), but GTK has now been used in a large number of software projects, including the GNU Network Object Model Environment (GNOME) project. GTK is built on top of GDK (GIMP Drawing Kit) which is basically a wrapper around the low-level functions for accessing the underlying windowing functions (Xlib in the case of the X windows system). The primary authors of GTK are:
Peter Mattis [mailto:[email protected] [email protected] ]
Spencer Kimball [mailto:[email protected] [email protected] ]
Josh MacDonald [mailto:[email protected] [email protected] ]
GTK is currently maintained by:
Owen Taylor [mailto:[email protected] [email protected] ]
Tim Janik [mailto:[email protected] [email protected] ]
GTK是一组面象的编程接口(API)。虽然它是用C语言写的,但是它在实现中遵循了“类”和“回调函数”的理念(pointers to functions)。
另外,还存在一个第三方的类,叫GLib,它包含的一些标准的calls,可以作为替代品。而且,GLib还包含了一些处理linked lists的函数,等等。这些可以作为替代的函数增强了GTK的可迁移性,因为GTK中的一些函数实现在另外一些类UNIX系统中是不标准或是没有的,比如g_strerror()。GLib还在一些地方对于libc版本的GTK更优秀,比如g_malloc有更强的可调试性。
在GLib的2.0版本中,使用了作为GTK类继承结构基础的类型系统,这个系统在GTK中使用广泛。有一个线程API,它抽象了各种系统平台的不同的本地线程API,而且还有loading modules的功能。
GTK使用Pango库来实现i18n的文本输出。