예제 #1
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
예제 #2
0
파일: progressbar.py 프로젝트: iske/PySolFC
 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.frame = Tkinter.Frame(self.top, relief='flat', bd=0,
                                takefocus=0)
     self.cframe = Tkinter.Frame(self.frame, relief='sunken', bd=1,
                                takefocus=0)
     self.canvas = Tkinter.Canvas(self.cframe, width=width, height=height,
                                  takefocus=0, bd=0, highlightthickness=0)
     self.scale = self.canvas.create_rectangle(-10, -10, 0, height,
                                               outline=color, fill=color)
     self.text = -1
     if show_text:
         self.text = self.canvas.create_text(0, 0, anchor=Tkinter.CENTER)
     self.cframe.grid_configure(column=0, row=0, sticky="ew")
     if images:
         self.f1 = Tkinter.Label(self.frame, image=images[0])
         self.f1.grid_configure(column=0, row=0, sticky="ew", ipadx=8, ipady=4)
         self.cframe.grid_configure(column=1, row=0, sticky="ew", padx=8)
         self.f2 = Tkinter.Label(self.frame, image=images[1])
         self.f2.grid_configure(column=2, row=0, sticky="ew", ipadx=8, ipady=4)
     self.top.config(cursor="watch")
     self.pack()
     if 1:
         setTransient(self.top, None, relx=0.5, rely=0.5)
     else:
         self.update(percent=0)
     self.norm = norm
     self.steps_sum = 0
예제 #3
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.frame = Tkinter.Frame(self.top, relief='flat', bd=0, takefocus=0)
     self.cframe = Tkinter.Frame(self.frame,
                                 relief='sunken',
                                 bd=1,
                                 takefocus=0)
     self.canvas = Tkinter.Canvas(self.cframe,
                                  width=width,
                                  height=height,
                                  takefocus=0,
                                  bd=0,
                                  highlightthickness=0)
     self.scale = self.canvas.create_rectangle(-10,
                                               -10,
                                               0,
                                               height,
                                               outline=color,
                                               fill=color)
     self.text = -1
     if show_text:
         self.text = self.canvas.create_text(0, 0, anchor=Tkinter.CENTER)
     self.cframe.grid_configure(column=0, row=0, sticky="ew")
     if images:
         self.f1 = Tkinter.Label(self.frame, image=images[0])
         self.f1.grid_configure(column=0,
                                row=0,
                                sticky="ew",
                                ipadx=8,
                                ipady=4)
         self.cframe.grid_configure(column=1, row=0, sticky="ew", padx=8)
         self.f2 = Tkinter.Label(self.frame, image=images[1])
         self.f2.grid_configure(column=2,
                                row=0,
                                sticky="ew",
                                ipadx=8,
                                ipady=4)
     self.top.config(cursor="watch")
     self.pack()
     if 1:
         setTransient(self.top, None, relx=0.5, rely=0.5)
     else:
         self.update(percent=0)
     self.norm = norm
     self.steps_sum = 0
예제 #4
0
파일: tkwidget.py 프로젝트: iske/PySolFC
 def mainloop(self, focus=None, timeout=0, transient=True):
     bind(self.top, "<Escape>", self.mCancel)
     bind(self.top, '<Alt-Key>', self.altKeyEvent) # for accelerators
     if focus is not None:
         focus.focus()
     if transient:
         setTransient(self.top, self.parent)
         try:
             self.top.grab_set()
         except Tkinter.TclError:
             if traceback: traceback.print_exc()
             pass
         if timeout > 0:
             self.timer = after(self.top, timeout, self.mTimeout)
         try: self.top.mainloop()
         except SystemExit:
             pass
         self.destroy()
예제 #5
0
 def mainloop(self, focus=None, timeout=0, transient=True):
     bind(self.top, "<Escape>", self.mCancel)
     bind(self.top, '<Alt-Key>', self.altKeyEvent)  # for accelerators
     if focus is not None:
         focus.focus()
     if transient:
         setTransient(self.top, self.parent)
         try:
             self.top.grab_set()
         except Tkinter.TclError:
             if traceback: traceback.print_exc()
             pass
         if timeout > 0:
             self.timer = after(self.top, timeout, self.mTimeout)
         try:
             self.top.mainloop()
         except SystemExit:
             pass
         self.destroy()
예제 #6
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