Exemplo n.º 1
0
    def __init__(self, parent, opname, interrupt=True, **kwargs):
        self.maximum = 100
        self.toplevel = tk.Toplevel(parent, **kwargs)
        self.toplevel.title(opname)
        self.toplevel.transient(parent)

        self.opname = opname

        self.count = tk.IntVar()

        self.label = tk.Label(self.toplevel, text=opname + ' progress: 0%')
        self.label.pack()

        self.count.set(-1)

        self.progress = ttk.Progressbar(self.toplevel, orient='horizontal',
                                        mode='determinate',
                                        variable=self.count,
                                        maximum=self.maximum)

        self.progress.pack(expand=True, fill=tk.BOTH, side=tk.TOP)
        self.interrupted = False
        if interrupt:
            interrupt_btn = tk.Button(self.toplevel, text='Interrupt',
                                      command=self.interrupt)
            interrupt_btn.pack()
Exemplo n.º 2
0
    def __init__(self, parent, opname, **kwargs):
        self.toplevel = tk.Toplevel(parent, **kwargs)
        self.toplevel.transient(parent)

        self.opname = opname

        self.label = tk.Label(self.toplevel, text=opname)
        self.label.pack()

        self.progress = ttk.Progressbar(self.toplevel,
                                        orient='horizontal',
                                        mode='indeterminate')

        self.progress.pack(expand=True, fill=tk.BOTH, side=tk.TOP)
Exemplo n.º 3
0
    def __init__(self, parent, opname, **kwargs):
        self.maximum = 100
        self.toplevel = tk.Toplevel(parent, **kwargs)
        self.toplevel.transient(parent)

        self.opname = opname

        self.count = tk.IntVar()

        self.label = tk.Label(self.toplevel, text=opname + ' progress: 0%')
        self.label.pack()

        self.progress = ttk.Progressbar(self.toplevel,
                                        orient='horizontal',
                                        mode='determinate',
                                        variable=self.count,
                                        maximum=self.maximum)

        self.progress.pack(expand=True, fill=tk.BOTH, side=tk.TOP)
Exemplo n.º 4
0
 def __init__(self,
              app,
              parent,
              title=None,
              images=None,
              color="blue",
              width=300,
              height=25,
              show_text=1,
              norm=1):
     self.parent = parent
     self.percent = 0
     self.top = makeToplevel(parent, title=title)
     self.top.wm_protocol("WM_DELETE_WINDOW", self.wmDeleteWindow)
     self.top.wm_group(parent)
     self.top.wm_resizable(False, False)
     self.top.config(cursor="watch")
     #
     self.frame = ttk.Frame(self.top, relief='flat', borderwidth=0)
     self.progress = ttk.Progressbar(self.frame, maximum=100, length=250)
     # style = ttk.Style(self.progress)
     # style.configure('TProgressbar', background=color)
     if images:
         self.f1 = ttk.Label(self.frame, image=images[0])
         self.f1.pack(side='left', ipadx=8, ipady=4)
         self.progress.pack(side='left', expand=True, fill='x')
         self.f2 = ttk.Label(self.frame, image=images[1])
         self.f2.pack(side='left', ipadx=8, ipady=4)
     else:
         self.progress.pack(expand=True, fill='x')
     self.frame.pack(expand=True, fill='both')
     if 1:
         setTransient(self.top, None, relx=0.5, rely=0.5)
     else:
         self.update(percent=0)
     self.norm = norm
     self.steps_sum = 0