In general, GNOME platform, together with glib, libgtk and many other libraries, it is not only a mechanism to implement graphic applications for GNOME desktop, but also a complete tool set to implement very different applications in top of varied purpose programming languages. Some examples of this kind of different libraries are:
- Pango: for text rendering
- Cairo: for 2D graphics rendering
- GStreamer: as Multimedia library for audio and video reproduction
- PulseAudio: as proxy for sound applications
Back to libgtk, this is basically a C library that allows programming widget base applications. However, there is a whole bunch of bindings to another languages that help on using and expanding the library to a wider set of programmers. Regarding this bindings, there are two well differentiated groups [1]:
- GNOME supported bindings:
Language | 2.10 | 2.12 | 2.14 | 2.16 | 2.18 | 2.20 | 2.22 | 2.24 | 3.0 | 3.2 | 3.4 | 3.6 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
C++ | |||||||||||||
C# | |||||||||||||
Java | |||||||||||||
Python | |||||||||||||
Javascript | |||||||||||||
Vala | |||||||||||||
Perl |
Legend
- Official GNOME Binding
- Supported
- Partially Supported
- Unsupported
- GNOME unsupported bindings:
Ruby | |||||||||||||
Pascal | |||||||||||||
PHP | |||||||||||||
R | |||||||||||||
Lua | |||||||||||||
Guile | |||||||||||||
Ada | |||||||||||||
OCaml | |||||||||||||
Haskell | |||||||||||||
FreeBASIC | |||||||||||||
D | |||||||||||||
Go | |||||||||||||
Fortran |
Legend
- Official GNOME Binding
- Supported
- Partially Supported
- Unsupported
Among unsupported languages, it is surprising that Ruby and PHP languages (13th and 5th most popular languages according to Tiobe programming language ranking [3]) are not supported bindings.
But, apart from the C++ binding, which is indeed the main development programming language on this project, which is the most popular binding ? Not much information is provided regarding this on the Internet, but initially, as one of the most popular programming languages, C++ and Java should be two of the most popular bindings. However, as an starting GTK developer, another binding always appears when looking on the Internet for information regarding GTK. That binding is pyGTK, So, from my ignorance, I would dare to assert that C++, Java, and Python should be the most used GTK bindings.
But why also Python? Well, as also a newbie in this programming language, I consider that the ease of programming with this programming language, as well as its increasing popularity in the Open Source scene, (obviously apart from Java, C/C++), help on this binding to be one of the most active ones.
But is Python on GTK really so easy? Well, a good example of this fact is the comparison of a GTK hello world provided by Tom Lee on his blog [4], Compared to other languages, it is shown that languages as Ruby, Perl or Python allows coding a "Hello World" application in much less words and lines that in other languages such as C:
- libgtk "Hello World" on C programming language:
#include <gtk/gtk.h>
int main (int argc, char **argv) {
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Hello, World");
g_signal_connect (G_OBJECT (window), "delete-event", gtk_main_quit, NULL);
gtk_widget_show_all (window);
gtk_main();
return 0;
}
- libgtk "Hello World" under Python programming language:
import pygtk
pygtk.require('2.0')
import gtk
window = gtk.Window()
window.set_title('Hello, World')
window.connect('delete-event', gtk.main_quit)
window.show_all()
gtk.main()
So, an eye must be kept on Python language binding, as it seems to be one of the most used and alive GTK bindings nowadays.
To summarize, no excuses around programming language used allowed to start programming visual interfaces on top of GTK, A wide bunch of bindings are supported, and several of them around the most used and easy programming languages.
References:
[1] http://www.gtk.org/language-bindings.php
[2] http://tomlee.co/2008/01/gtk-hello-world-in-six-different-languages/
[3] http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
[4] http://tomlee.co/2008/01/gtk-hello-world-in-six-different-languages/
No hay comentarios:
Publicar un comentario