Thanks James, and sorry by doing lost your time.<br>When I worked with the second patch from Anish, I understand more changes needed.<br><br>The new patch is <a href="http://lists.sugarlabs.org/archive/sugar-devel/2010-November/028511.html">http://lists.sugarlabs.org/archive/sugar-devel/2010-November/028511.html</a><br>
<br>Gonzalo<br><br><br><div class="gmail_quote">On Tue, Nov 2, 2010 at 9:39 PM, James Cameron <span dir="ltr"><<a href="mailto:quozl@laptop.org">quozl@laptop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Reviewed-by: James Cameron <<a href="mailto:quozl@laptop.org">quozl@laptop.org</a>><br>
<div class="im"><br>
On Tue, Nov 02, 2010 at 10:07:21AM -0300, <a href="mailto:godiard@sugarlabs.org">godiard@sugarlabs.org</a> wrote:<br>
> From: Gonzalo Odiard <<a href="mailto:godiard@sugarlabs.org">godiard@sugarlabs.org</a>><br>
><br>
<br>
</div>No commit message body, but the subject said it well.<br>
<div class="im"><br>
> -        activity_toolbar.insert(gobutton, 2)<br>
> +        activity_toolbar.insert(gobutton, -1 if OLD_TOOLBAR else 2)<br>
<br>
</div>I'd like to see this factored out into a function.  Here's what I mean:<br>
<div class="im"><br>
<br>
diff --git a/pippy_app.py b/pippy_app.py<br>
</div>index fc8aaaa..01a6020 100644<br>
<div class="im">--- a/pippy_app.py<br>
+++ b/pippy_app.py<br>
@@ -45,6 +45,12 @@ PYTHON_PREFIX="""#!/usr/bin/python<br>
 # -*- coding: utf-8 -*-<br>
 """<br>
<br>
+OLD_TOOLBAR = False<br>
+try:<br>
+    from sugar.graphics.toolbarbox import ToolbarBox<br>
+except ImportError:<br>
+    OLD_TOOLBAR = True<br>
+<br>
 # get screen sizes<br>
 SIZE_X = gtk.gdk.screen_width()<br>
 SIZE_Y = gtk.gdk.screen_height()<br>
</div>@@ -80,6 +86,13 @@ class PippyActivity(ViewSourceActivity, groupthink.sugar_tools.GroupActivity):<br>
<div class="im">         palette.menu.append(menu_item)<br>
         menu_item.show()<br>
<br>
+       if OLD_TOOLBAR:<br>
+           activity_toolbar = gtk.Toolbar()<br>
+           toolbox.add_toolbar('Pippy',activity_toolbar)<br>
+           toolbox.set_current_toolbar(1)<br>
</div>+        def pos(x):<br>
+            return -1 if OLD_TOOLBAR else x<br>
<div class="im">+<br>
         # The "go" button<br>
         goicon_bw = gtk.Image()<br>
         goicon_bw.set_from_file("%s/icons/run_bw.svg" % os.getcwd())<br>
</div>@@ -92,7 +105,7 @@ class PippyActivity(ViewSourceActivity, groupthink.sugar_tools.GroupActivity):<br>
<div class="im">         gobutton.connect('clicked', self.flash_cb, dict({'bw':goicon_bw,<br>
             'color':goicon_color}))<br>
         gobutton.connect('clicked', self.gobutton_cb)<br>
-        activity_toolbar.insert(gobutton, 2)<br>
</div>+        activity_toolbar.insert(gobutton, pos(2))<br>
<div class="im"><br>
         # The "stop" button<br>
         stopicon_bw = gtk.Image()<br>
</div>@@ -106,7 +119,7 @@ class PippyActivity(ViewSourceActivity, groupthink.sugar_tools.GroupActivity):<br>
<div class="im">             'color':stopicon_color}))<br>
         stopbutton.connect('clicked', self.stopbutton_cb)<br>
         stopbutton.set_tooltip("Stop Running")<br>
-        activity_toolbar.insert(stopbutton, 3)<br>
</div>+        activity_toolbar.insert(stopbutton, pos(3))<br>
<div class="im"><br>
         # The "clear" button<br>
         clearicon_bw = gtk.Image()<br>
</div>@@ -120,12 +133,12 @@ class PippyActivity(ViewSourceActivity, groupthink.sugar_tools.GroupActivity):<br>
<div class="im">         clearbutton.connect('clicked', self.flash_cb, dict({'bw':clearicon_bw,<br>
             'color':clearicon_color}))<br>
         clearbutton.set_tooltip("Clear")<br>
-        activity_toolbar.insert(clearbutton, 4)<br>
</div>+        activity_toolbar.insert(clearbutton, pos(4))<br>
<div class="im"><br>
         # A vertical toolbar separator<br>
         separator = gtk.SeparatorToolItem()<br>
         separator.set_draw(True)<br>
-        activity_toolbar.insert(separator, 5)<br>
</div>+        activity_toolbar.insert(separator, pos(5))<br>
<div><div></div><div class="h5">         activity_toolbar.show_all()<br>
<br>
         self.set_toolbox(toolbox)<br>
<br>
--<br>
</div></div><font color="#888888">James Cameron<br>
<a href="http://quozl.linux.org.au/" target="_blank">http://quozl.linux.org.au/</a><br>
_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</font></blockquote></div><br>