sugar-toolkit-gtk3/shell/HomeWindow.py

34 lines
730 B
Python
Raw Normal View History

2006-07-08 11:56:13 +02:00
import gtk
import goocanvas
class Model(goocanvas.CanvasModelSimple):
def __init__(self):
goocanvas.CanvasModelSimple.__init__(self)
root = self.get_root_item()
item = goocanvas.Rect(x=0, y=0, width=693, height=520,
fill_color="red")
root.add_child(item)
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)
self._shell = shell
2006-07-18 21:13:10 +02:00
self.connect('realize', self.__realize_cb)
canvas = goocanvas.CanvasView()
canvas_model = Model()
canvas.set_bounds(0, 0, 693, 520)
self.add(canvas)
canvas.show()
canvas.set_model(canvas_model)
canvas.set_size_request(693, 520)
2006-07-18 21:13:10 +02:00
def __realize_cb(self, window):
self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DESKTOP)