2006-07-08 11:56:13 +02:00
|
|
|
import gtk
|
2006-08-15 12:20:09 +02:00
|
|
|
import goocanvas
|
2006-07-14 15:47:42 +02:00
|
|
|
|
2006-08-16 19:55:13 +02:00
|
|
|
from sugar.canvas.IconItem import IconItem
|
|
|
|
|
2006-08-15 12:20:09 +02:00
|
|
|
class Model(goocanvas.CanvasModelSimple):
|
|
|
|
def __init__(self):
|
|
|
|
goocanvas.CanvasModelSimple.__init__(self)
|
2006-07-14 15:47:42 +02:00
|
|
|
|
2006-08-15 12:20:09 +02:00
|
|
|
root = self.get_root_item()
|
2006-07-10 13:42:34 +02:00
|
|
|
|
2006-08-15 12:20:09 +02:00
|
|
|
item = goocanvas.Rect(x=0, y=0, width=693, height=520,
|
|
|
|
fill_color="red")
|
2006-08-16 19:55:13 +02:00
|
|
|
root.add_child(item)
|
2006-07-13 11:10:27 +02:00
|
|
|
|
2006-08-16 19:55:13 +02:00
|
|
|
item = IconItem('buddy')
|
|
|
|
#item.set_color('blue')
|
2006-08-15 12:20:09 +02:00
|
|
|
root.add_child(item)
|
2006-07-10 13:42:34 +02:00
|
|
|
|
2006-07-08 11:56:13 +02:00
|
|
|
class HomeWindow(gtk.Window):
|
2006-07-08 15:47:51 +02:00
|
|
|
def __init__(self, shell):
|
2006-07-08 11:56:13 +02:00
|
|
|
gtk.Window.__init__(self)
|
2006-07-13 11:10:27 +02:00
|
|
|
|
2006-07-10 13:42:34 +02:00
|
|
|
self._shell = shell
|
2006-07-13 11:10:27 +02:00
|
|
|
|
2006-07-18 21:13:10 +02:00
|
|
|
self.connect('realize', self.__realize_cb)
|
2006-07-13 11:10:27 +02:00
|
|
|
|
2006-08-15 12:20:09 +02:00
|
|
|
canvas = goocanvas.CanvasView()
|
|
|
|
canvas_model = Model()
|
|
|
|
canvas.set_bounds(0, 0, 693, 520)
|
|
|
|
self.add(canvas)
|
|
|
|
canvas.show()
|
2006-07-13 11:10:27 +02:00
|
|
|
|
2006-08-15 12:20:09 +02:00
|
|
|
canvas.set_model(canvas_model)
|
|
|
|
canvas.set_size_request(693, 520)
|
2006-07-10 13:42:34 +02:00
|
|
|
|
2006-07-18 21:13:10 +02:00
|
|
|
def __realize_cb(self, window):
|
|
|
|
self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DESKTOP)
|