2006-09-08 14:22:31 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
import pygtk
|
|
|
|
pygtk.require('2.0')
|
|
|
|
|
2006-09-10 02:54:05 +02:00
|
|
|
from sugar.session.UITestSession import UITestSession
|
|
|
|
|
|
|
|
session = UITestSession()
|
|
|
|
session.start()
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import random
|
|
|
|
|
|
|
|
import gtk
|
2006-10-02 01:50:43 +02:00
|
|
|
import hippo
|
2006-09-08 14:22:31 +02:00
|
|
|
|
2006-10-04 00:55:20 +02:00
|
|
|
from sugar.graphics import IconColor
|
|
|
|
from sugar.graphics.CanvasIcon import CanvasIcon
|
|
|
|
from sugar.graphics.CanvasView import CanvasView
|
2006-09-08 14:22:31 +02:00
|
|
|
|
|
|
|
window = gtk.Window()
|
|
|
|
window.connect("destroy", lambda w: gtk.main_quit())
|
|
|
|
window.show()
|
|
|
|
|
2006-10-02 01:50:43 +02:00
|
|
|
canvas = hippo.Canvas()
|
2006-09-08 14:22:31 +02:00
|
|
|
canvas.show()
|
|
|
|
window.add(canvas)
|
|
|
|
|
2006-10-02 01:50:43 +02:00
|
|
|
box = hippo.CanvasBox(background_color=0x4f4f4fff)
|
|
|
|
canvas.set_root(box)
|
2006-09-08 14:22:31 +02:00
|
|
|
|
2006-09-08 15:26:27 +02:00
|
|
|
icon_names = [ 'stock-buddy', 'activity-groupchat', 'activity-web']
|
|
|
|
|
2006-09-08 14:22:31 +02:00
|
|
|
k = 0
|
2006-10-02 01:50:43 +02:00
|
|
|
while k < 1:
|
2006-09-08 14:22:31 +02:00
|
|
|
i = 0
|
2006-10-02 01:50:43 +02:00
|
|
|
while i < 10:
|
2006-09-08 14:22:31 +02:00
|
|
|
color = IconColor.IconColor()
|
2006-09-08 15:26:27 +02:00
|
|
|
icon_name_n = int(random.random() * len(icon_names))
|
2006-10-02 01:50:43 +02:00
|
|
|
icon = CanvasIcon(icon_name=icon_names[icon_name_n],
|
|
|
|
size=75, color=color)
|
|
|
|
box.append(icon, 0)
|
2006-09-08 14:22:31 +02:00
|
|
|
i += 1
|
|
|
|
k += 1
|
|
|
|
|
|
|
|
gtk.main()
|