From 2a2554f157d977efb182e55bb71e5c38d4ae4263 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 8 Sep 2006 14:22:31 +0200 Subject: [PATCH] forgot to add files --- tests/test-icons.py | 43 +++++++++++++++++++++++++++++++++++++++++++ tools/run-test.sh | 5 +++++ 2 files changed, 48 insertions(+) create mode 100755 tests/test-icons.py create mode 100755 tools/run-test.sh diff --git a/tests/test-icons.py b/tests/test-icons.py new file mode 100755 index 00000000..ff453568 --- /dev/null +++ b/tests/test-icons.py @@ -0,0 +1,43 @@ +#!/usr/bin/python + +import pygtk +pygtk.require('2.0') +import gtk + +import goocanvas + +from sugar.canvas import IconColor +from sugar.canvas.IconItem import IconItem + +window = gtk.Window() +window.connect("destroy", lambda w: gtk.main_quit()) +window.set_default_size(800, 600) +window.show() + +canvas = goocanvas.CanvasView() +canvas.set_size_request(800, 600) +canvas.set_bounds(0, 0, 800, 600) +canvas.show() +window.add(canvas) + +canvas_model = goocanvas.CanvasModelSimple() +root = canvas_model.get_root_item() + +item = goocanvas.Rect(x=0, y=0, width=800, height=600, + line_width=0.0, fill_color="#4f4f4f") +root.add_child(item) + +k = 0 +while k < 11: + i = 0 + while i < 16: + color = IconColor.IconColor() + icon = IconItem(x=i * 50, y=k * 50, size=46, color=color, + icon_name='stock-buddy') + root.add_child(icon) + i += 1 + k += 1 + +canvas.set_model(canvas_model) + +gtk.main() diff --git a/tools/run-test.sh b/tools/run-test.sh new file mode 100755 index 00000000..23c7368f --- /dev/null +++ b/tools/run-test.sh @@ -0,0 +1,5 @@ +Xephyr :50 -ac -screen 800x600 & + +DISPLAY=:50 +matchbox-window-manager & +exec $*