fixed screenshot capability, calls get pixbuf in drawing area
authorjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Mon, 29 Jun 2009 23:36:20 +0000 (23:36 +0000)
committerjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Mon, 29 Jun 2009 23:36:20 +0000 (23:36 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11307 221aa14e-8319-0410-a670-987f0aec2ac5

grc/gui/ActionHandler.py
grc/gui/DrawingArea.py

index 2c411a175a88c4752066c3e871f792bbf3b543e5..ff137f6697074b657ece3f5ab2d90ce6a2db2c50 100644 (file)
@@ -297,10 +297,7 @@ class ActionHandler:
                elif state == Actions.FLOW_GRAPH_SCREEN_CAPTURE:
                        file_path = SaveImageFileDialog(self.get_page().get_file_path()).run()
                        if file_path is not None:
-                               pixmap = self.get_flow_graph().get_pixmap()
-                               width, height = pixmap.get_size()
-                               pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, 0, 8, width, height)
-                               pixbuf.get_from_drawable(pixmap, pixmap.get_colormap(), 0, 0, 0, 0, width, height)
+                               pixbuf = self.get_flow_graph().get_drawing_area().get_pixbuf()
                                pixbuf.save(file_path, IMAGE_FILE_EXTENSION[1:])
                ##################################################
                # Gen/Exec/Stop
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