Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/graphics/hipposcalability.py
blob: 490d571bb3e201eddee1350038c4a9357cefbb8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 = CanvasRoundBox(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)