Wrap the canvas inside a gtk.EventBox to make it easier

to take screenshot of the canvas area only.
This commit is contained in:
Marco Pesenti Gritti 2007-11-04 17:16:16 +01:00
parent 108147a6b1
commit 7f731457c2

View File

@ -35,14 +35,19 @@ class Window(gtk.Window):
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