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

牧云@^-^@ 提交于 2019-12-08 17:59:25

问题


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


回答1:


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.




回答2:


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


来源:https://stackoverflow.com/questions/5920049/learning-gui-programming-with-gtk2-or-gtk3

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