Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/graphics/window.py
blob: 85cbc4e168844a0e61a63ba2d086b6abd19c4b9f (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
import hippo
import gtk

from sugar.graphics import color

class _Style(gtk.Style):
    __gtype_name__ = 'SugarCanvasStyle'
    def __init__(self):
        gtk.Style.__init__(self)

    def do_set_background(self, window, state):
        window.set_back_pixmap(None, False)

class Window(gtk.Window):
    def __init__(self, window_type=gtk.WINDOW_TOPLEVEL):
        gtk.Window.__init__(self, window_type)

        self._canvas = hippo.Canvas()
        self._canvas.set_style(_Style())
        self.add(self._canvas)
        self._canvas.show()

    def set_root(self, root):
        self._canvas.set_root(root)