PyGObject GtkBuilder




Hello,

This is my first use of PyGObject. I am trying to port Guake terminal application (www.guake.org) to use PyGObject and I have some problems with getting GtkBuilder working with PyGObject. I am using latest git version of PyGObject.

The error:
Traceback (most recent call last):
File "/home/aleksandar/gnome/root/usr/lib/guake/guake.py", line 1384, in <module>
    if not main():
File "/home/aleksandar/gnome/root/usr/lib/guake/guake.py", line 1327, in main
    instance = Guake()
File "/home/aleksandar/gnome/root/usr/lib/guake/guake.py", line 524, in __init__
    super(Guake, self).__init__(gladefile('guake.ui'))
File "/home/aleksandar/gnome/root/usr/lib/guake/simplegtkapp.py", line 76, in __init__
    self.builder.add_from_file(path)
File "/home/aleksandar/gnome/root/lib/python2.6/site-packages/gtk-2.0/gi/types.py", line 40, in function
    return info.invoke(*args)
TypeError: instance: Must be Gtk.Builder, not Builder

The code where the error occurs:
    def __init__(self, path, callbacks_proxy=None):
        """
        Load a GtkBuilder ui definition file specified by path.
        If callbacks_proxy is specified it will be used as object to
        to connect the signals, otherwise self will be used.
        """
        self.builder = Gtk.Builder()
        self.builder.add_from_file(path) # <<<<< line 76
        if callbacks_proxy:
            self.builder.connect_signals(callbacks_proxy)
        else:
            self.builder.connect_signals(self)

On top of the file I am importing Gtk with "from gi.repository import Gtk" and I have also tried to import Gdk and GdkPixbuf as shown in the builder.py demo from PyGObject repository, but nothing helps.

Does anyone have any clue about the source of this error?

/Aleksandar


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]