j stowers wrote:
>
> What idiom is this? Why are you constructing self.myobject that way? Why
> are you not just super() or chaining up in __init__(self)?
>

It is known as "idiot idiom" aka trial and error.
If I omit that line,  it fails later on at a line reading 
     self.vbox = Gtk.VBox()
with a complaint about wrong number of parameters for GObject.__init__() 

>
> > ERROR:root:Could not find any typelib for Gdk
> > ERROR:root:Could not find any typelib for Gtk
> > Traceback (most recent call last):
> > File "/home/lumby/pythonapps/togglegobj.py", line 24, in 
> > from gi.repository import Gdk, Gtk, GObject
> > ImportError: cannot import name Gdk
> >
> >
> > Any idea why it can't find Gdk and what I could look for to fix it?
>
> No idea. Many many things could have gone wrong. Check where the
> typelibs are installed and check if they can be found with the
> GI_TYPELIB_PATH environment variable (IIRC).
>

Thanks again John   -  yes,  it is certainly related to the typelibs.
On this custom system, the girepository-1.0 directory does not have a typelib 
for gtk.
It has just these typelibs:

 Atk-1.0
 xrandr-1.3
 xlib-2.0
 xft-2.0
 xfixes-4.0
 libxml2-2.0
 freetype2-2.0
 fontconfig-2.0
 cairo-1.0
 Gio-2.0
 GObject-2.0
 GModule-2.0
 GLib-2.0
 GL-1.0
 GIRepository-2.0
 DBusGLib-1.0
 DBus-1.0

On the F14,  there are many more including gtk.

Now,  the strange thing (to me) is that these were all (except one, Atk) 
installed during the make install
phase of building gobject-introspection-0.10.3 itself.   I would (I think) have 
expected each one to be put
there by its own package.    How does gobject-introspection know which packages 
to build typelibs for?
There does not appear to be any configure option for this.

The Atk typelib was built by the Atk build process,  which did this
/usr/local/bin/g-ir-compiler  --includedir=. Atk-1.0.gir -o Atk-1.0.typelib

Am I supposed to run g-ir-compiler on similar ${package}.gir's of the other 
packages?
I will give that a try but again if you or someone can say how this is supposed 
to be done
I would appreciate.

 Cheers, John Lumby

                                          
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to