Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GObject Gtk, Gnome, Gtk+, Gl, Gtk2, Gtk3...I don't understand?

Tags:

gtk

gobject

gtk2

all I need some window to host webkit or/and cairo drwaing, but i have to deal with all that first to understand what I'm doing.

now. I'm lost and no more understand what's all that about.

and things get worse when I try working with binding or trying to figure what are dependencies for something. for example: in python, pyGtk deprecated and replaced by pyGObject(sometimes called pyGl!!)

there are many sites, many downloads and versions, mixed outdated and new references,but not one architectural view of the whole thing.

what I don't understand..is how all these things mixed with each other in too many sites,packages and versions?

like image 810
KA1 Avatar asked Mar 12 '12 13:03

KA1


People also ask

What is gtk2 and GTK3?

GTK 3 is a major new version of GTK that breaks both API and ABI compared to GTK 2. x, which has remained API- and ABI-stable for a long time. Thankfully, most of the changes are not hard to adapt to and there are a number of steps that you can take to prepare your GTK 2. x application for the switch to GTK 3.

What is GTK used for?

GTK (formerly GIMP ToolKit and GTK+) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprietary software to use it.

Is Gnome based on GTK?

GTK is at the heart of the GNOME application and software development kit. GTK is used to create graphical user interfaces (GUIs) for desktop environments, applications, and window managers.


2 Answers

The short story:

If you're programming for GTK 2, use pyGTK.

If you're programming for GTK 3, use pyGObject.

The long story:

From what I understood, pyGTK was based on pyGObject. GObject is the "object" API of GTK. GTK is developped in C, which is not an object-oriented language. GObject is a library that provides advanced object-oriented facilies. All GTK objects inherit from the GObject class provided by that library.

Then came the GObject-introspection work. Its goal was to make bindings maintenance easier, and use source code annotations to automatically generate most of the bindings code for each language (python, C++, etc.). This resulted in the python side in pyGI, the python bindings based on the GObject introspection work. That's when people were told to use it for GTK3 development.

Since then, the GObject-introspection work once provided by pyGI has been integrated into GObject. pyGObject eventually became what developers should use for python development in GTK3.

Please read:

  • https://wiki.gnome.org/Projects/PyGObject

About the GNOME/GTK relationship:

GTK is the toolkit used by the GNOME project. It has been extracted from the GIMP, hence its name (GTK stands for: GIMP Tool Kit). GTK is a core part of the GNOME project, and GTK developers often also are involved in the GNOME project.

like image 53
liberforce Avatar answered Sep 20 '22 15:09

liberforce


My understanding of those components you mentioned:

Dependency chain of the components mentioned in the question, in GNOME 2

Dependency chain of the components mentioned in the question, in GNOME 3

  • Think of GI as an interface that the core GNOME libraries conform to.
  • PyGI doesn't exist any more; it's now part of PyGObject in the GNOME 3 setup.
  • What is the relation between GTK, GTK+ and GTK2?
like image 24
Johannes Sasongko Avatar answered Sep 20 '22 15:09

Johannes Sasongko