Re: PyGObject GtkBuilder
- From: John Palmieri <johnp redhat com>
- To: Aleksandar Krsteski <alekrsteski gmail com>
- Cc: python-hackers-list gnome org
- Subject: Re: PyGObject GtkBuilder
- Date: Thu, 28 Oct 2010 12:17:58 -0400 (EDT)
Hi Aleksandar,
Sorry no one has replied in a long time. For one thing I see this:
gladefile('guake.ui')
is guake.ui in glade format? That might be an issue. I'm not sure. What I am really guessing is that one of the objects you are loading is somehow causing an error when being constructed. Can you point me to your code so I can test it on my machine? Thanks.
----- "Aleksandar Krsteski" <alekrsteski gmail com> wrote:
> 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
> _______________________________________________
> python-hackers-list mailing list
> python-hackers-list gnome org
> http://mail.gnome.org/mailman/listinfo/python-hackers-list
--
--
John (J5) Palmieri
Software Engineer
Red Hat, Inc.
[
Date Prev][
Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]