fixed screenshot capability, calls get pixbuf in drawing area
[debian/gnuradio] / grc / gui / DrawingArea.py
index 6f90049c50b4e162db97cbb7636dda32e710ff9a..b70468ed03f44ba481d0a7f1e88e621fe02b445c 100644 (file)
@@ -62,6 +62,11 @@ class DrawingArea(gtk.DrawingArea):
                self.connect('enter-notify-event', _handle_focus_event, True)
 
        def new_pixmap(self, width, height): return gtk.gdk.Pixmap(self.window, width, height, -1)
+       def get_pixbuf(self):
+               width, height = self._pixmap.get_size()
+               pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, 0, 8, width, height)
+               pixbuf.get_from_drawable(self._pixmap, self._pixmap.get_colormap(), 0, 0, 0, 0, width, height)
+               return pixbuf
 
        ##########################################################################
        ## Handlers