Question

I am learning Python GTK+3 using the tutorial listed on docs.python.org . More specifically, I am trying to execute this demo program which is based on ListBox.

When I tried to execute it,shell returned the following error :

File "listboxex.py", line 55, in <module>
    win=ListBoxWindow()
File "listboxex.py", line 12, in __init__
    listbox=Gtk.ListBox()
File "/usr/lib/python2.7/dist-packages/gi/module.py", line 313, in __getattr__
    return getattr(self._introspection_module, name)
File "/usr/lib/python2.7/dist-packages/gi/module.py", line 134, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Gtk' object has no attribute 'ListBox'

Where am I going wrong? Also I notice that shell is executing my code using Python 2.7. Should I be using Python 3 or Python 3.3 to execute my code? I am a linux/Ubuntu newbie so please tell me how!

Was it helpful?

Solution

your version of the GTK+ C library does not have the GtkListBox widget. the GtkListBox widget has been introduced in GTK+ 3.10, which was released in September 2013. Ubuntu 13.10 only has GTK+ 3.8, and 14.04 will add GTK+ 3.10.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top