Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/graphics2/window.py
diff options
context:
space:
mode:
Diffstat (limited to 'sugar/graphics2/window.py')
-rw-r--r--sugar/graphics2/window.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/sugar/graphics2/window.py b/sugar/graphics2/window.py
index 068d177..d03788b 100644
--- a/sugar/graphics2/window.py
+++ b/sugar/graphics2/window.py
@@ -31,8 +31,19 @@ class Window(gtk.Window):
vbox.pack_start(self.toolbox, False)
self.toolbox.show()
+ self._canvas_box = gtk.VBox()
+ vbox.pack_start(self._canvas_box)
+ self._canvas_box.show()
+
self.canvas = hippo.Canvas()
- vbox.pack_start(self.canvas)
+ self._canvas_box.pack_start(self.canvas)
self.canvas.show()
vbox.show()
+
+ def set_canvas(self, canvas):
+ if self.canvas:
+ self._canvas_box.remove(self.canvas)
+
+ self._canvas_box.add(canvas)
+ self.canvas = canvas