Please bear with me as I'm a newcomer to Linux. I've been writing GUI programs in REALbasic on a Mac for several years. I'm trying to learn Python and I want to write GUI apps for Linux (primarily Ubuntu and Mint since they are the distros I have access to and they seem to be the most popular). I basically have three questions:

  1. Are there any significant differences between GTK and QT
  2. I've toyed with quickly and Glade on Ubuntu but I understand that they are based on GTK 2 and this is now obsolete. Is that correct?
  3. Are there any all-in-one editors that let me design a GUI and then add Python code to it? (for instance, add a button to a window in the editor, double click the button and then add the Python code that is to execute when the button is pressed)

Sorry if these are really dumb questions but I want to start learning the 'right' tools from the start.

  • 3
    I don't have time right now to answer your questions, but I can clarify something. Glade used to be both a library, a format for a UI definition file and an application to create those .glade files. Now we use GtkBuilder for what the Glade format used to do, and that is built in to GTK. Glade the application lives on as a great tool to make .ui files for GtkBuilder (or simply to test different layouts), and Glade 3.x certainly does do Gtk3 — though not everything is there at this moment. Dec 4, 2011 at 21:52
  • 1
    That is very helpful. So if I decide to use GTK as my toolkit then I'd use Glade to design the layout and another tool to link my Pyhton code and the UI design - correct?
    – Nootrino
    Dec 5, 2011 at 7:15
  • 1
    Yep, and that tool is part of GTK, so it's documented over here: developer.gnome.org/gtk3/3.1/GtkBuilder.html I'm linking you to the C documentation because it's pretty detailed, and when you're using PyGObject the only real difference will be the syntax. In Python, the names and stuff will look something like this: valadoc.org/gtk+-3.0/Gtk.Builder.html Dec 5, 2011 at 8:32

3 Answers 3


I'll try to answer your questions, without going in crazy directions.

  1. They are significantly different, even though they are both widget libs. Regular GTK+ is based on C, and QT on C++. Although bindings exist for almost every programming languages.

  2. You are fairly correct about GTK2, although there are so many GTK2 applications. I expect GTK2 to be in use for a while, just as GTK1 was. When push comes to shove, GTK2 is deprecated, and if you are starting fresh go GTK3.

  3. Remeber GTK, and QT, are just widget toolkits. For example... Gnome applications, use GTK and also the Gnome-Libs. If you want that, take a look at vala. It is considered simple, the vala compiles source-to-source directly to C, and has full bindings for many programming languages. You might also want to look at Anjuta, just make sure you have the new gtk3 versions. Apparently strait PyGTK only supports GTK2, current last I checked. If you are looking to avoid all Linux DE libs, I would suggest looking at QT. Plain QT is different from KDE applications, which include KDE libs. QT is considered very cross-platform, which is cool if you want to compile for non *nix. If you want to get started with QT + Python, look at PySide (LGPL) or PyQT (GPL). QT has some good GUI builders like qt creator, and qt-designer.

  • Thanks for this. Anjuta pretty much looks like what I have been after. I'm going to play around with it a bit. If it's not right then I will look at QT. It strikes me that both GTK and QT achieve the same end result - it's just a matter of preference I guess.
    – Nootrino
    Dec 5, 2011 at 7:17
  • Qt is much more than just a widget toolkit. It is an entire framework, replicating large chunks of the STL and Boost.
    – scottl
    Dec 6, 2011 at 1:30
  • @scottl, I was not trying to limit QT. While QT is more capable than just widgets, it's in that context it became part of the potential solution. Dec 8, 2011 at 10:53
  • @Nootrino: you have to remember in the FLOSS world, there is often more than one established solution. The reason many people have chosen, one or the other, is based on their C vs, C++ standing. Of course, licence played a bigger part in the past. Regardless other frameworks in many languages exist, you usually agree more with one method. Dec 8, 2011 at 11:00
  • @Nootrino: I'm glad I was able to actually help! Dec 8, 2011 at 11:01

GTK and Qt are open-source cross-platform User Interface toolkits and development frameworks. These are the two most popular frameworks in use for Linux because they are open-source and give developers a powerful toolkit to design Graphical User Interfaces. GTK is used as the standard toolkit for the GNOME, LXDE and Xfce Desktop Environments while Qt is used for KDE.

If you code in C, then obviously go for GTK+

If you code in C++, go for Qt, otherwise you will ned Gtkmm (a C++ wrapper over GTK+)

If you code in Python, both GTK+ and Qt have bindings for the language: see PyGtk, PyQt and PySide (the one launched by Nokia themselves).

  • 1
    If you're using Python, PyGTK is deprecated. For new projects you will be much better off using PyGObject (python-gobject in Ubuntu's repository): live.gnome.org/PyGObject PyGObject lets you connect to any library built on GLib (such as GTK) through Python, without any extra layers. You get something very much like PyGTK, but it goes about it quite differently. And, of course, PyGObject is the only way to talk to GTK3 through Python. Dec 4, 2011 at 22:00

Qt is mainly used in KDE, and GTK+ in GNOME. So if you want to develop for GNOME, consider GTK+ since the necessary dependencies for GTK+ libraries should already be installed on a GNOME system; the end user will not need to install them. GTK+ development is also benefited by a tool called Glade Interface Designer; if you wish, you can use that to create your user interfaces.

  • 5
    QT is a cross platform toolkit it is not only used in KDE, and so is GTK. AND please refrain from writting "txt lik dis"... Dec 4, 2011 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.