GUI開發工具包 GTK+ 介紹
GTK(GIMP Toolkit)是一套跨多種平臺的圖形工具包,按LGPL許可協議發布的。雖然最初是為GIMP寫的,但目前已發展為一個功能強大、設計靈活的一個通用 圖形庫。特別是被GNOME選中使得GTK+廣為流傳,成為Linux下開發圖形界面的應用程序的主流開發工具之一,當然GTK+并不要求必須在 Linux上,事實上,目前GTK+已經有了成功的windows版本。
GTK雖然是用C語言寫的,但是您可以使用你熟悉的語言了使用GTK,因為GTK+已經被綁定到幾乎所有流行的語言上,如:C++, Guile, Perl, Python, TOM, Ada95, Objective C, Free Pascal, and Eiffel。
它具有以下特性:
Stability
GTK+ has been developed for over a decade to be able to deliver the enticing features and superb performance that it brings to your application development. GTK+ is supported by a large community of developers and has core maintainers from companies such as Red Hat, Novell, Lanedo, Codethink, Openismus and Intel.
Language Bindings
GTK+ is available in many other programming languages thanks to the language bindings available. This makes GTK+ quite an attractive toolkit for application development.
Interfaces
GTK+ has a comprehensive collection of core widgets and interfaces for use in your application.
- Windows (normal window or dialog, about and assistant dialogs)
- Displays (label, image, progress bar, status bar)
- Buttons and toggles (check buttons, radio buttons, toggle buttons and link buttons)
- Numerical (horizontal or vertical scales and spin buttons) and text data entry (with or without completion)
- Multi-line text editor
- Tree, list and icon grid viewer (with customizable renderers and model/view separation)
- Combo box (with or without an entry)
- Menus (with images, radio buttons and check items)
- Toolbars (with radio buttons, toggle buttons and menu buttons)
- GtkBuilder (creates your user interface from XML)
- Selectors (color selection, file chooser, font selection)
- Layouts (tabulated widget, table widget, expander widget, frames, separators and more)
- Status icon (notification area on Linux, tray icon on Windows)
- Printing widgets
- Recently used documents (menu, dialog and manager)
Cross Platform
Originally GTK+ was developed for the X Window System but it has grown over the years to include backend support for other well known windowing systems. Today you can use GTK+ on:
Accommodating
GTK+ caters for a number features that today's developers are looking for in a toolkit including:
- Native look and feel
- Theme support
- Thread safety
- Object oriented approach
- Internationalization
- Localization
- Accessibility
- Bidirectional text support (LTR/RTL, Left To Right/Right To Left)
- UTF8 support
- Documentation
Foundations
GTK+ is built on top of GLib. GLib provides the fundamental algorithmic language constructs commonly duplicated in applications. This library has features such as: (this list is not a comprehensive list)
- Object and type system
- Main loop
- Dynamic loading of modules (i.e. plug-ins)
- Thread support
- Timer support
- Memory allocator
- Threaded Queues (synchronous and asynchronous)
- Lists (singly linked, doubly linked, double ended)
- Hash tables
- Arrays
- Trees (N-ary and binary balanced)
- String utilities and charset handling
- Lexical scanner and XML parser
- Base64 (encoding & decoding)
Mobile
The GMAE (GNOME Mobile & Embedded) initiative has advanced the use, development and commercialization of GNOME components as a mobile and embedded user experience platform. It has brought together industry leaders, expert consultants, key developers and the community and industry organizations they represent. As a direct result of this, GTK+ has features pertaining to mobile and embedded platform requirements.
GTK+ has been involved in a number of embedded initiatives over the past few years including the development of: