[Sugar-devel] [sugar-toolkit-gtk3] Finish the port of ColorToolButton to gtk3

Gonzalo Odiard godiard at gmail.com
Tue Aug 7 15:09:29 EDT 2012


This patch is needed by Paint port to Gtk3, but can be tested applying the
following patch to HelloWorld activity:

diff --git a/activity.py b/activity.py
index 2252983..96ee5d3 100644
--- a/activity.py
+++ b/activity.py
@@ -28,6 +28,8 @@ from sugar3.activity.widgets import TitleEntry
 from sugar3.activity.widgets import StopButton
 from sugar3.activity.widgets import ShareButton
 from sugar3.activity.widgets import DescriptionItem
+from sugar3.graphics.colorbutton import ColorToolButton

 class HelloWorldActivity(activity.Activity):
     """HelloWorldActivity class as specified in activity.info"""
@@ -58,7 +60,14 @@ class HelloWorldActivity(activity.Activity):
         share_button = ShareButton(self)
         toolbar_box.toolbar.insert(share_button, -1)
         share_button.show()
+
+        color = ColorToolButton()
+        tool_item = Gtk.ToolItem()
+        tool_item.add(color)
+        color.show()
+        tool_item.show()
+        toolbar_box.toolbar.insert(tool_item, -1)
+
         separator = Gtk.SeparatorToolItem()
         separator.props.draw = False
         separator.set_expand(True)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120807/02841950/attachment.html>


More information about the Sugar-devel mailing list