pygtk does ... ?

T

Thomas Bartkus

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
 
D

Dave Cook

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,951
Messages
2,570,113
Members
46,698
Latest member
alexxx

Latest Threads

Top