commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r11307 - gnuradio/trunk/grc/gui


From: jblum
Subject: [Commit-gnuradio] r11307 - gnuradio/trunk/grc/gui
Date: Mon, 29 Jun 2009 17:36:20 -0600 (MDT)

Author: jblum
Date: 2009-06-29 17:36:20 -0600 (Mon, 29 Jun 2009)
New Revision: 11307

Modified:
   gnuradio/trunk/grc/gui/ActionHandler.py
   gnuradio/trunk/grc/gui/DrawingArea.py
Log:
fixed screenshot capability, calls get pixbuf in drawing area

Modified: gnuradio/trunk/grc/gui/ActionHandler.py
===================================================================
--- gnuradio/trunk/grc/gui/ActionHandler.py     2009-06-29 04:55:42 UTC (rev 
11306)
+++ gnuradio/trunk/grc/gui/ActionHandler.py     2009-06-29 23:36:20 UTC (rev 
11307)
@@ -297,10 +297,7 @@
                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

Modified: gnuradio/trunk/grc/gui/DrawingArea.py
===================================================================
--- gnuradio/trunk/grc/gui/DrawingArea.py       2009-06-29 04:55:42 UTC (rev 
11306)
+++ gnuradio/trunk/grc/gui/DrawingArea.py       2009-06-29 23:36:20 UTC (rev 
11307)
@@ -62,6 +62,11 @@
                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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]