[Sugar-devel] gtk.RadioToolButton active property not recognized

James Cameron quozl at laptop.org
Wed May 18 08:05:43 EDT 2011


On Sat, May 14, 2011 at 11:51:05AM +0200, laurent bernabe wrote:
>   * in my application, i'm using two gtk.RadioToolButton
>   * the "clicked" handlers of the two RadioToolButton test the active
>   property of the event source (so, the RadioToolButton itself)
>   * but the SugarOLPC image logs reports me the error "
>   'gtk.RadioToolButton' has no attribute 'active' "
>   * however, the PyGTK reference manual says that 'active' is a
>   property of gtk.ToggleToolButton, from which RadioToolButton is
>   inherited and therefore, handlers are not properly executed
> 
> So, what is my error ?

You are using GTK+ version 2.0, according to your mail in another thread.

You are using PyGTK version 2.17.0, according to your mail in another
thread.

The PyGTK 2.24.0 documentation for ToggleToolButton at
http://developer.gnome.org/pygtk/stable/class-gtktoggletoolbutton.html
has a note to the right of the "active" property which says "This
property is available in GTK+ 2.8 and above."  The implication is that
the property is not available below GTK+ 2.8.  Since you have GTK+
version 2.0, the property is expected to be unavailable.

But it is surprising that you are using GTK+ version 2.0 ... could you
please check this version number?  It would be easy for you to misread
the output:

	COLUMNS=120 dpkg --list libgtk\*-dev

Here I see:

	ii libgtk2.0-dev 2.24.3-1~sid1 Development files for the GTK+ library

Which means I am using version 2.24.3.  The 2.0 in the package name is
not a version number.  This is an easy mistake to make.

Assuming you are using a version of GTK+ of 2.8 or later, I see no
explanation for your error.  I would need to see the source.  Please
post a pointer to your git repository, or web page containing the
source.

By the way, you can obtain matching version documentation for PyGTK on
your system by installing the package python-gtk2-doc, and then opening
the files on the system rather than on internet.

-- 
James Cameron
http://quozl.linux.org.au/


More information about the Sugar-devel mailing list