From 7f731457c2b20bbfb37b78d4da6db55cb62d56b5 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sun, 04 Nov 2007 16:16:16 +0000 Subject: Wrap the canvas inside a gtk.EventBox to make it easier to take screenshot of the canvas area only. --- (limited to 'lib') diff --git a/lib/sugar/graphics/window.py b/lib/sugar/graphics/window.py index 003f870..3b3394a 100644 --- a/lib/sugar/graphics/window.py +++ b/lib/sugar/graphics/window.py @@ -34,15 +34,20 @@ class Window(gtk.Window): self._hbox = gtk.HBox() self._vbox.pack_start(self._hbox) self._hbox.show() + + self._event_box = gtk.EventBox() + self._hbox.pack_start(self._event_box) + self._event_box.show() self.add(self._vbox) self._vbox.show() def set_canvas(self, canvas): if self.canvas: - self._hbox.remove(self.canvas) + self._event_box.remove(self.canvas) - self._hbox.pack_start(canvas) + if canvas: + self._event_box.add(canvas) self.canvas = canvas -- cgit v0.9.1