Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Learning GUI programming with GTK+2 or GTK+3?

I am new to GUI programming, and I haven't found yet what library is best for my purpose (i want to make desktop environment applications, eg. docks, panels, desklets etc.) I have started learning basics of GTK, mainly using PyGtk. Most tutorials i found on line are for GTK+2.0. Recently however, GTK+3 has been released. So i am a bit unsure as to what that means for my learning curve:

  • Should i learn using GTK+3 and forget about GTK+2?
  • Does using one or the other really makes a difference from the point of view of coding?
  • Are there PyGTK bindings for GTK+3 already?
  • Is there any available tutorial for GTK+3?

Since i'm new to this, i'm throwing myself into it blindly, but a bit of guidance may be wiser. So if you have any, you're welcome :)

like image 498
neydroydrec Avatar asked May 07 '11 08:05

neydroydrec


People also ask

Is GTK a GUI ToolKit?

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 GTK a programming language?

GTK is written using the C programming language, but its also available to various programming languages through language bindings, which allow writing GTK applications in the style of those languages. Language bindings are relatively easy to create because GTK is designed with them in mind.

Can I use GTK commercially?

GTK (GIMP Toolkit) is a library for creating graphical user interfaces. It is licensed using the LGPL license, so you can develop open software, free software, or even commercial non-free software using GTK without having to spend anything for licenses or royalties.

What is GTK2 and GTK3?

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.


2 Answers

Definitely go with GTK 3. The 10-minute tutorials on http://developer.gnome.org/ use GTK 3 and are an excellent introduction to programming with GTK in several languages, including Python. In the coming months you will probably see more tutorials appear for GTK 3, and in the meantime, you will still be able to get most tutorials for GTK 2 to work with a minimum of fuss. The basics aren't all that different.

like image 65
ptomato Avatar answered Oct 06 '22 18:10

ptomato


Although late, I would like to share this information in the hope that it will be useful for anyone who have this doubt in future.

As ptomato said, GTK+ 3 is the way to go and much of the GTK+2 knowledge is applicable to GTK+3 also. PyGObject is the way to go with GTK+3, not PyGTK. See: PyGTK, GObject, and GNOME 3 to get an overall idea about this new change.

To know what differs and how to cope up with these changes, see:

  • Migrating from GTK+ 2.x to GTK+ 3
  • Porting Documentation

About the tutorials, following ones will be of helpful:

  • The Python GTK+ 3 Tutorial
  • GNOME Developer Platform Demos
  • Screen-casts by daniel g. siegel
  • GTK+ 3 Reference Manual
like image 31
Jomoos Avatar answered Oct 06 '22 17:10

Jomoos