32

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.

Nootrino
  • 657

3 Answers3

14

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.

J. M. Becker
  • 1,585
  • 2
  • 13
  • 20
7

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).

One Zero
  • 27,761
-2

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.

Eliah Kagan
  • 119,640
kosaidpo
  • 231