Ejemplo n.º 1
0
    def __init__(self, master, msg, delay=5, relief='solid', func=None):
        self.root = tk.Toplevel(master=master)
        #hides until know geometry
        self.root.withdraw()
        self.root.wm_overrideredirect(1)
        tk.Label(self.root, text="   %s   " % msg,
                 bd=1, bg='DodgerBlue4', fg='white').pack()
        gui.centerWindows(self.root, refWindows=master)
        self.root.deiconify()
        self.root.grab_set()
        self.msg = msg

        if func:
            self.root.update_idletasks()
            self.root.after(10, self.proccess, func)
        else:
            self.root.after(int(delay*1000), self.close)
        self.root.wait_window(self.root)
Ejemplo n.º 2
0
    def __init__(self, master, msg, delay=5, relief='solid', func=None):
        self.root = tk.Toplevel(master=master)
        #hides until know geometry
        self.root.withdraw()
        self.root.wm_overrideredirect(1)
        tk.Label(self.root, text="   %s   " % msg,
                 bd=1, bg='DodgerBlue4', fg='white').pack()
        gui.centerWindows(self.root, refWindows=master)
        self.root.deiconify()
        self.root.grab_set()
        self.msg = msg

        if func:
            self.root.update_idletasks()
            self.root.after(10, self.proccess, func)
        else:
            self.root.after(int(delay*1000), self.close)
        self.root.wait_window(self.root)
Ejemplo n.º 3
0
    if envVarOn('SCIPION_EXTERNAL_VIEWER'):
        openTextFileEditor(filename)
    else:
        showTextFileViewer("File viewer", [filename])    
    
    
def openTextFileEditor(filename):
    try:
        _open_cmd(filename)
    except:
        showTextFileViewer("File viewer", [filename])
    
    
def showTextFileViewer(title, filelist, parent=None, main=False):
    w = gui.Window(title, parent, minsize=(600, 400))
    viewer = TextFileViewer(w.root, filelist, maxSize=-1)
    viewer.grid(row=0, column=0, sticky='news')
    gui.configureWeigths(w.root)
    w.show()


if __name__ == '__main__':
    root = tk.Tk()
    root.withdraw()
    root.title("View files")
    l = TextFileViewer(root, fileList=sys.argv[1:])
    l.pack(side=tk.TOP, fill=tk.BOTH)
    gui.centerWindows(root)
    root.deiconify()
    root.mainloop()
Ejemplo n.º 4
0
    if envVarOn('SCIPION_EXTERNAL_VIEWER'):
        openTextFileEditor(filename)
    else:
        showTextFileViewer("File viewer", [filename])    
    
    
def openTextFileEditor(filename, tkParent=None):
    try:
        _open_cmd(filename,tkParent)
    except:
        showTextFileViewer("File viewer", [filename])
    
    
def showTextFileViewer(title, filelist, parent=None, main=False):
    w = gui.Window(title, parent, minsize=(600, 400))
    viewer = TextFileViewer(w.root, filelist, maxSize=-1)
    viewer.grid(row=0, column=0, sticky='news')
    gui.configureWeigths(w.root)
    w.show()


if __name__ == '__main__':
    root = tk.Tk()
    root.withdraw()
    root.title("View files")
    l = TextFileViewer(root, fileList=sys.argv[1:])
    l.pack(side=tk.TOP, fill=tk.BOTH)
    gui.centerWindows(root)
    root.deiconify()
    root.mainloop()