Ejemplo n.º 1
0
class GuiOutputBox(Toplevel):
    def __init__(self, parent=None):
        Toplevel.__init__(self, parent)            # single window model
        self.box = GuiOutput(self)                 # embed an output frame 
    def runShellCmd(self, cmd, mode=THREAD):
        redirectGuiShellCmd(cmd, mode, self.box)
    def runFunction(self, func, pargs, kargs, mode=BLOCK):
        redirectGuiFunc(func, pargs, kargs, mode, self.box)
    def write(self, line):
        self.box.write(line)
Ejemplo n.º 2
0
 def existingBox1():
     win = Toplevel()
     box = GuiOutput(win)
     box.pack()
     Button(win, text='OK', command=win.destroy).pack()  # erase window
     box.write('--Hello GuiStreams world--\n')
     redirectGuiShellCmd('ls *.py', BLOCK, box)
     box.write('--Second command--\n')
     redirectGuiShellCmd('ls *.txt', BLOCK, box)
     box.write('--Command finished--\n')