0
votes

In the code file i have to link just one library (from gi.repository import Gtk). But when i run it it replies me:

Gtk-WARNING **: Unknown property: GtkTextView.input-purpose

ERROR --file: collega_GUI --riga: 160, 'Grid' object has no attribute 'get_child_at'

So i tried to find missing libraries:

$ dpkg -l libgtk[0-9]* | grep ^i

ii  libgtk2.0-0    2.24.10-0ubuntu6    GTK+ graphical user interface library
ii  libgtk2.0-bin  2.24.10-0ubuntu6    programs for the GTK+ graphical user interface library
ii  libgtk2.0-common  2.24.10-0ubuntu6     common files for the GTK+ graphical user interface library
ii  libgtk2.0-dev  2.24.10-0ubuntu6    development files for the GTK+ library

and Grid object needs gtk3+, so let's install it:

$ sudo apt-get install libgtk-3-0 libgtk-3-common libgtk-3-dev libgtk-3-doc

0 updated, 0 installed, 0 removed and 0 not upgraded

So it's all fine with libraries and:

  1. gtk-grid-get-child-at exists

  2. GtkTextView--input-purpose exists

  3. that "input-purpose" problem is strange, because on the previous OS (ubuntu 13.10, now i'm on 12.04) i didn't get that problem.

The UI is built by Glade, but i never get that error previously: on the same project files, but on a different OS version.

I still think i need to install some libraries.

EDIT :: ged_child_at function call

griglia = self.__builder.get_object('grid3')
                for i in range(0, 3):
                    area = griglia.get_child_at(i, 0)
                    self.__builder.get_object(Gtk.Buildable.get_name(area)).connect("draw", self.draw)
1

1 Answers

0
votes

The tag Since 3.6 for that property which means in Gtk+ 3.4 (which is the default of ubuntu 12.04 if I recall correctly).

So you either work around it or you go the thorny way of upgrading to Gtk+ 3.6 - which I - with all respect - do strongly disrecommend - especially since Unity needs various patches being incorporated into Gtk+ to work at all.


I just checked in gtk+-3.10.x the python bindings are fine and include get_child_at(..).

This question contains an answer that in fact this is a bug in the python bindings of gtk+ 3.4.

Solutions: Backport the git commit that fixes this (should be very tiny git commit) recompile/create deb package (significant knowledge required).

An alternate route would be to locally fix the binding specification and recreate the python introspection bindings locally - not sure if that is possible though - never did that.