On Sat, Aug 03, 2002 at 12:15:50AM +0800, James Henstridge wrote:
> Thomas Leonard wrote:
[...]
> >If you want to write programs that will still work even if someone has
> >installed James' version instead, you can just start the main file with:
> >
> > try:
> > import gtk2 as gtk
> > except:
> > import gtk
> > assert gtk.Window
[...]
> The current situation is no different to the current situation with C
> programs trying to compile against gtk+.
>
> Both gtk+ 1.2 and 2.0 use the same include file namespace (<gtk/*.h>),
> and the same function/type namespaces (gtk_* and Gtk*). If you want the
> compiler to correctly link a program, you need to tell it where the
> correct set of headers for the version of gtk+ is with a compiler flag.
> It is also possible to install the two different versions of pygtk in
> different location (currently by specifying a different prefix. I will
> probably add a configure argument to set the actual dir), and then
> setting PYTHONPATH to point at the desired version.
There is one *tiny* difference... installing Gtk2 doesn't stop all your
other programs from working. That is, downloading and using the normal
'./configure; make; make install' doesn't have the surprising side-effect
of killing galeon, for example.
Whereas, doing the same thing with pygtk will kill sketch, pythontheater,
etc. Note that Gtk provides a very easy way for C programs to discover the
location of the headers, whereas pygtk doesn't provide any way to locate
the modules.
Also, the libraries have different names:
libgtk-1.2.so.0
libgtk-x11-2.0.so
Each C program (binary) contains either one of these two names, allowing
the system to locate the correct library. However, the equivalent python
binaries only contain the name 'gtk'.
Whatever the mechanics of it, and whatever analogy you choose, the effect
from a user or developer's POV is:
- Gtk2 doesn't break things.
- Pygtk2 does.
--
Thomas Leonard http://rox.sourceforge.net
[EMAIL PROTECTED] [EMAIL PROTECTED]
GPG: 9242 9807 C985 3C07 44A6 8B9A AE07 8280 59A5 3CC1
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/