By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,215 Members | 1,936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,215 IT Pros & Developers. It's quick & easy.

pygtk does ... ?

P: n/a
I am experimenting (flailing around?) with glade and python. Both under MS
Windows and Linux.

I understand why I want to "import gtk"
It gives me access to the critical gui program loop
gtk.main() and main_quit()

I am also very grateful for
import gtk.glade
This lets me open my xml format glade file
gtk.glade.XML("MyGladeFile.glade")
full of defined gtk widgets and the function
signal_autoconnect(dic)
which lets me hang my Python callback routines onto those gtk widgets.

Whew! At least I've gotten started. It sure wasn't easy.

The question is -
What the heck is the pygtk library for?

help(pygtk) tells me not much more than -
"Python bindings for the GTK+ widget set"

Why would I want to "import pygtk" with it's single function
"require(version)"?
What is it supposed to do? Where does it fit in?

Or does it fit in at all?
Thomas Bartkus

Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 2005-07-08, Thomas Bartkus <th***********@comcast.net> wrote:
Why would I want to "import pygtk" with it's single function
"require(version)"?
What is it supposed to do? Where does it fit in?


The only reason I can think of is to use pygtk.require, so you can specify
which major version of pygtk you want to use, assuming you have multiple
versions:

import pygtk
pygtk.require('2.0')
import gtk

Otherwise, you don't need to import pygtk, just gtk.

Dave Cook
Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.