sugar-toolkit-gtk3/shell/HomeWindow.py
Marco Pesenti Gritti a6ef49b731 Make HomeWindow a canvas. Modify screen resolution to
match what Walter said.
2006-08-15 12:20:09 +02:00

32 lines
707 B
Python

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)
class HomeWindow(gtk.Window):
def __init__(self, shell):
gtk.Window.__init__(self)
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)
def __realize_cb(self, window):
self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DESKTOP)