[Sugar-devel] Problem converting an activity from 0.82 to 0.86

Behavior Vehikel b.vehikel at googlemail.com
Sun Nov 8 15:23:47 EST 2009

Last months I developed a activity for sugar. I used sugar 0.82 on
Ubuntu 8.10. The activity is not ready yet, but works running in
Now I am testing my new activity using Trisquel 3.0 with sugar 0.86.2.
But I can not get the GUI running. On sugar 0.86.2 I got an exception
when I try to set the canvas. Same source code works on 0.82. Maybe
there is an error in my  source code and 0.82 is more tolerant.

How to port from 0.82 to 0.86?
Is there a list of (breaking) changes or deprecated methods?

Tanks, Thomas

Here are the details:
1257703419.020482 DEBUG Kandid: searching for extensions in

1257703419.114374 DEBUG Kandid: Starting activity...

1257703419.209278 WARNING root: No gtk.AccelGroup in the top level window.

1257703419.217976 WARNING root: No gtk.AccelGroup in the top level window.

DeprecationWarning: use toolbar_box instead of toolbox

  warnings.warn('use toolbar_box instead of toolbox', DeprecationWarning)

1257703419.278926 DEBUG Kandid: set_canvas(self._main_view) [<gtk.HBox
object at 0xa59ce3c (GtkHBox at 0xad9c628)>]

Traceback (most recent call last):

  File "/usr/bin/sugar-activity", line 21, in <module>


  File "/var/lib/python-support/python2.6/sugar/activity/main.py",
line 146, in main

    create_activity_instance(activity_constructor, activity_handle)

  File "/var/lib/python-support/python2.6/sugar/activity/main.py",
line 35, in create_activity_instance

    activity = constructor(handle)

  File "/usr/share/sugar/activities/Kandid.activity/activity.py", line
69, in __init__


  File "/var/lib/python-support/python2.6/sugar/activity/activity.py",
line 402, in set_canvas

    Window.set_canvas(self, canvas)

  File "/var/lib/python-support/python2.6/sugar/graphics/window.py",
line 174, in set_canvas


TypeError: GtkContainer.remove() argument 1 must be gtk.Widget, not KandidCanvas

Activity died: pid 5473 condition 256 data (None, <open file
'<fdopen>', mode 'w' at 0x9d137a0>)

Source code:
    def __init__(self, handle):
        activity.Activity.__init__(self, handle)
        self._name = handle
        ka_debug.info('Starting activity...')

        # Set title for our Activity

        # Attach sugar toolbox (Share, ...)
        toolbox = activity.ActivityToolbox(self)

        # Create the main container
#        self._main_view = gtk.VBox()
        self._main_view = gtk.HBox()

        # Create GUI and attach that widget to our window
        self._canvas = ka_canvas.KandidCanvas()

        # Display everything
        ka_debug.info('set_canvas(self._main_view) [%s]' % (self._main_view))
        self.set_canvas(self._main_view)               # <-- Activity died here


More information about the Sugar-devel mailing list