J Stowers wrote:

>
> Firstly, F-14 is probably too old. This pygobject+g-i has moved a lot in the 
> last few months.
>

Thanks John.    Eventually I got it working on that F-14 system
(without upgrading any packages).

> 
> * use glib (i.e. static bindings) and GObject (from gi.repository import 
> GObject)
>
> Here is a new app written in pygobject+g-i
>
> https://github.com/nzjrs/gnome-tweak-tool
>

After looking at your Tweaker and tinkering a bit, in my case,
the key statements appear to have been:

from gi.repository import Gdk, Gtk, GObject
...
class ToggleBut(Gtk.Window):
    def __init__(self, parent=None):
        self.mywindow = Gtk.Window.__init__(self)
        self.myobject = GObject.__init__() 

After that, things fell into place.

Now I still need some help if poss:

I took this same python app unchanged to another system where I have built
packages myself.    It is python 2.6,  but all other packages are the
latest versions as of very recently. 

The original pygtk form of the app works fine there, but this pygobject-form 
fails like so:

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 <module>
    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?
I have stared at install directories and can't see anything amiss  -
e.g. the set of files in and under:
F14's           /usr/lib/python2.7/site-packages/gtk-2.0/gi
custom-sys's    /usr/local/lib/python2.6/site-packages/gtk-2.0/gi
appear to be the same (names,  not content)
 except for a couple of libtool xxx.la's in the custom one.
I can easily upgrade python to 2.7 if that might help but would prefer to have
some idea what I am looking for.

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