diff options
author | Simon Poirier <simpoir@gmail.com> | 2009-03-22 00:26:04 (GMT) |
---|---|---|
committer | Simon Poirier <simpoir@gmail.com> | 2009-03-22 00:26:04 (GMT) |
commit | 625f9bb52eda3215d82d1b76ec6a806459f321ce (patch) | |
tree | 4e1d9a00a5d830fd9f5392980d606e2143d24a30 /sugar-toolkit/tests/graphics/hipposcalability.py |
Initial commit
Diffstat (limited to 'sugar-toolkit/tests/graphics/hipposcalability.py')
-rw-r--r-- | sugar-toolkit/tests/graphics/hipposcalability.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/sugar-toolkit/tests/graphics/hipposcalability.py b/sugar-toolkit/tests/graphics/hipposcalability.py new file mode 100644 index 0000000..a5cebcc --- /dev/null +++ b/sugar-toolkit/tests/graphics/hipposcalability.py @@ -0,0 +1,50 @@ +import hippo +import gtk +import gobject + +from sugar.graphics.icon import CanvasIcon +from sugar.graphics.roundbox import CanvasRoundBox + +import common + +test = common.Test() + +canvas = hippo.Canvas() +test.pack_start(canvas) +canvas.show() + +scrollbars = hippo.CanvasScrollbars() +canvas.set_root(scrollbars) + +box = hippo.CanvasBox(padding=10, spacing=10) +scrollbars.set_root(box) + +def idle_cb(): + global countdown + + for i in range(0, 100): + entry = hippo.CanvasBox(border=2, border_color=0x000000ff, + orientation=hippo.ORIENTATION_HORIZONTAL, + padding=10, spacing=10) + + for j in range(0, 3): + icon = CanvasIcon(icon_name='go-left') + entry.append(icon) + + for j in range(0, 2): + text = hippo.CanvasText(text='Text %s %s' % (countdown, j)) + entry.append(text) + + box.append(entry) + + countdown -= 1 + + return countdown > 0 + +countdown = 1000 +gobject.idle_add(idle_cb) + +test.show() + +if __name__ == "__main__": + common.main(test) |