What is the relation between GTK, GTK+ and GTK2?

拈花ヽ惹草 提交于 2019-12-20 11:03:06

问题


I'm confused by the GTK terminology. According to Wikipedia, there seem to be bindings to GTK+ that are called GTK (GtkAda) and GTK2 (gtk2hs, Gtk2-Perl).

Could someone clear this up for me?


回答1:


GTK/GTK+ and GTK2 are different versions of the same API. GTK is an old, deprecated version, GTK2 is the previous one, GTK+ 3/GTK3 is the current version.

GTK+ is the correct name of the old API, but most people just call it GTK.

The C++ bindings for GTK+ are part of the project GTKmm.




回答2:


The first incarnation of the project was called GTK (which stood for GIMP Toolkit).

At some very early point, while the project was still part of The GIMP (and before version 1.0), it was renamed to GTK+. Despite this, people often referred to it as GTK out of convenience or ignorance.

The GTK+ name was used for more than 20 years through versions 1.x, 2.x, and 3.x, but the "GIMP Toolkit" expansion was dropped. I don't know when exactly this happened but perhaps during the 1.x → 2.x transition.

There is nothing officially called GTK2. It's just what some people call the 2.x series of GTK+.

On 2019-02-06, the project was renamed back to GTK, which will affect version 4.0 onwards.




回答3:


GTK is the library for creating GUI-s for Linux / GNU. It has several versions (I think the latest is version 3).

In order for other programming languages to use it (other than C), there have to exist libraries that can bind GTK to that particular language.

PHP-GTK means that there's a library binding GTK to PHP enabling PHP to create apps that can be displayed in a nice interface. It supports, however, only up to version 2.2 of the GTK. Same goes for other languages, they have a prefix / suffix and (GtkAda for example) those libraries also tell you up to what version they support GTK (since you might want to try newer GTK functions that aren't available in the library binding GTK to your language).



来源:https://stackoverflow.com/questions/5830731/what-is-the-relation-between-gtk-gtk-and-gtk2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!