Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-11-04 16:16:16 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-11-04 16:16:16 (GMT)
commit7f731457c2b20bbfb37b78d4da6db55cb62d56b5 (patch)
treed88cfbb855fca33fee816df7e15a719ed0f8a2fa /lib
parent108147a6b1ee82250db00e7cf0a925773786c9b4 (diff)
Wrap the canvas inside a gtk.EventBox to make it easier
to take screenshot of the canvas area only.
Diffstat (limited to 'lib')
-rw-r--r--lib/sugar/graphics/window.py9
1 files changed, 7 insertions, 2 deletions
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