[Pycodeocr-main] SF.net SVN: pycodeocr:[71] branches/redesign
Status: Beta
Brought to you by:
drtrigon
From: <la...@us...> - 2014-09-05 08:08:04
|
Revision: 71 http://sourceforge.net/p/pycodeocr/code/71 Author: laserb Date: 2014-09-05 08:08:01 +0000 (Fri, 05 Sep 2014) Log Message: ----------- Fix old output not removed. Modified Paths: -------------- branches/redesign/PyCodeOCR.py branches/redesign/gtkGUI/ImagePreview.py Modified: branches/redesign/PyCodeOCR.py =================================================================== --- branches/redesign/PyCodeOCR.py 2014-08-28 14:57:01 UTC (rev 70) +++ branches/redesign/PyCodeOCR.py 2014-09-05 08:08:01 UTC (rev 71) @@ -115,6 +115,7 @@ # run recognition self.progressbar.resetProgress("") + self.imagePreview.removeAll() runRecognition = Recognition.RunRecognition(self.source, sourceProperties, self.imageRecognition, recognitionProperties) runRecognition.connect("updateRecognition", self.onProgressUpdate) runRecognition.connect("recognized", self.on_recognized) Modified: branches/redesign/gtkGUI/ImagePreview.py =================================================================== --- branches/redesign/gtkGUI/ImagePreview.py 2014-08-28 14:57:01 UTC (rev 70) +++ branches/redesign/gtkGUI/ImagePreview.py 2014-09-05 08:08:01 UTC (rev 71) @@ -122,6 +122,10 @@ self.output.addText(text, self.res_color[mode]) else: self.output.addText(content, self.res_color[mode]) + + def removeAll(self): + self.output.removeAll() + self.main_image.set_from_file( "PyCodeOCR.png" ) def setRecognitionData(self, recognitionData): self.recognitionData = recognitionData @@ -131,7 +135,7 @@ # @see http://stackoverflow.com/questions/7906814/converting-pil-image-to-gtk-pixbuf def image_to_pixbuf(self, image): fd = StringIO.StringIO() - self.recognitionData.getImage().save(fd, "png") + image.save(fd, "png") contents = fd.getvalue() fd.close() loader = gtk.gdk.PixbufLoader("png") @@ -192,9 +196,11 @@ self.remove(self.button[text]) def removeAll(self): - for button in self.button: - self.remove(button[0]) - + children = self.get_children() + for child in children: + self.remove(child) + self.button = {} + def copyClipboard(self, widget): label = widget.get_label() label = label.split("\n")[0] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |