Python+Glade+Gtk tutorial?

Jason Heeris jason.heeris at gmail.com
Tue Mar 17 01:22:31 EDT 2015


Warning: I'm only going to answer half of your questions :)

I haven't built any GTK2/3 app in a while, but hopefully others here can
address your other questions (although you might have better luck on the
Python/GTK mailing list when it comes to finding a good tutorial, etc.)

On 17 March 2015 at 03:13, Dave Farrance <
DaveFarrance at omitthisyahooandthis.co.uk> wrote:
> A web-search told me that Glade seems to be most peoples choice (over
> QT-Designer) for a GUI builder.  So even though I use a KDE desktop
> (Kubuntu 14.10), I decided to try Glade.

In terms of toolkit bindings, (a) I prefer GTK, but (b) it's impossible to
tell what the greater proportion of people using one vs. the other is. Or
if they're wise to do so. Are there more Google hits/SO questions because
it's harder to use? Or because everyone loves to use it? (And so on...)

A recent comment on my SO answer to a similar question claims PyQT/PySide
is a good way to go, with a couple of links there you might find
interesting: http://stackoverflow.com/a/3290724/188535

I wouldn't stress over it though; you can give yourself a headache trying
to decide between frameworks you've never developed in. Try one, commit to
developing at least some proficiency in it, and then try the other.

> "from gi.repository import Gtk, Gdk, GObject, Pango" etc...
>
> ... I get, in effect, the libraries used in Gnome-3 even with python2?

Yes. The GTK and Python versions are independent. You can make GTK3 apps
with either Python 2 or 3. It's purely coincidence that Python 3 and GTK3
came out around the same time.

Going the other way, Gnome 3 still includes some GTK2 apps, but I think
you'd get little sympathy for starting a *new* app in GTK2 instead of 3.

> Am I on the right track now?  Glade is a good choice for GUI building? And
> even though I'm using Python2, I should be ignoring all examples turned up
> by searching for "PyGTK" because they all seem to be GTK+2 and obsolete?

Glade is good, although eventually you learn the lesson that it's not going
to give you 100% control over your UI — there are some things you are
better off doing in your app setup code.

And yes, I'd recommend ignoring anything labelled PyGTK.

— Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150317/72289a9d/attachment.html>


More information about the Python-list mailing list