GTK

From LQWiki
Jump to: navigation, search

GTK is the Gimp ToolKit. It is a set of C libraries for creating graphical applications. Its most notable use is in the Gimp, the GNU Image Manipulation Program, and the GNOME Desktop, but it has been used as the front end for many applications.

GTK 1.2 is the older version of GTK, it is only still seen in use in some programs like XMMS.

GTK 2 is the newer more advanced version of GTK, and is not compatible with programs made for GTK-1.2, as such both versions of GTK can be safely installed on the same machine, and usually are. GTK-2 also has more advanced theme capabilities compared to its predecessor

both versions have theme engines, a external library that describes in more detail on how to do the theming (usually can add things like gradients, or other visual features, and gives control over the feel and overall look of a theme), just like the 2 GTK versions are not compatible, the theme must also be written for either GTK-1.2 theming, or GTK-2 theming

GTK components

  • GDK is basically a wrapper for xlib, in fact its almost an exact replica if you look at the functions, however GDK uses different data types, for example, the variable Window in xlib, is not compatible with GDK's equivalent, making it dificult to use xlib, and GDK in the same program.
  • Pango is a library that mainly sets a framework for using internationalized text in GTK-2, it can easily be used out of GTK or GNOME programs, as Pango uses unicode for encoding of text.
  • ATK defines a set of interfaces and widgets, used by GTK-2 widgets, to allow other programs to interact with the widgets for the main purpose of accessibility. This is also a non-GTK specific library.
  • GLib is more or less, the core of GTK, it defines lots of functions used by GTK, such as event loops, threads, or almost any other low level OS related task.
  • GTK top level library that rests on all the previous, and wrappers for things such as the main event loop, and most importantly has the widgets

NOTE: GDK, GTK, and GLib are the only libraries used in GTK-1.2, of course the ones in GTK-1.2 are different from those in GTK-2

GTK theme engines

GTK theme engines are can be compiled from source or installed using a packAge manager.

GTK-1.2 theme engines

  • smooth engine - fast and light engine that can resemble other engines at times.
  • thinice
  • Xenophilia
  • raleigh - comes with GTK.
  • XenoStep

GTK-2 theme engines

  • smooth engine - fast and light engine that can resemble other engines at times.
  • thinice
  • xfce-engine
  • gtk-qt - a theme engine that uses qt for drawing the widets, basically turning GTK-2 applications into qt ones.
  • CleanIce - based on thinice and clean engines.
  • Industrial engine
  • pixmap engine - basically all this does is use pictures, giving it the ability to have almost any look.

Installing GTK themes

Go to these websites to download GTK themes. There are others.

Once the themes are downloaded, exract them. There will be a folder with the name of the theme. Inside that folder, there should be a folder called gtk-2.0. Take the folder with the name of the theme and put it in either ~/.themes or /usr/share/themes/.

To get the theme to work, use the tools that came with your desktop environment or window manager. If there are none, then use a program called switch2 or sometimes gtk-theme-switch. This program will edit the .gtkrc file in your home directory, which can be done manually.

Sometimes a theme will require a theming engine. Install the ones that it tells you to if they aren't pre-installed.

See also