+# http://www.blog.pythonlibrary.org/2014/07/14/tkinter-redirecting-stdout-stderr/
+class RedirectText (object):
+ def __init__ (self, widget):
+ self.widget = widget
+
+ def write (self, string):
+ self.widget.insert (END, string)
+
+
+class CryptoInstallProgress (Toplevel):
+ def __init__ (self):
+ Toplevel.__init__ (self)
+
+ self.create_widgets ()
+
+ def create_widgets (self):
+ self.balloon = Balloon (self, initwait = 250)
+
+ self.text = ScrolledText (self)
+ self.text.pack (fill = BOTH, expand = True)
+
+ self.redirect = RedirectText (self.text)
+
+ self._quit = Button (self)
+ self._quit["text"] = "Quit"
+ self._quit["command"] = self.quit
+ self.balloon.bind_widget (self._quit,
+ msg = "Quit the program immediately")
+ self._quit.pack ()
+
+