Python tkinter.ttk.Progressbar() Examples
The following are 30
code examples of tkinter.ttk.Progressbar().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
tkinter.ttk
, or try the search function
.
Example #1
Source File: box.py From synthesizer with GNU Lesser General Public License v3.0 | 8 votes |
def __init__(self, master): super().__init__(master, text="Levels", padding=4) self.lowest_level = Player.levelmeter_lowest self.pbvar_left = tk.IntVar() self.pbvar_right = tk.IntVar() pbstyle = ttk.Style() # pbstyle.theme_use("classic") # clam, alt, default, classic pbstyle.configure("green.Vertical.TProgressbar", troughcolor="gray", background="light green") pbstyle.configure("yellow.Vertical.TProgressbar", troughcolor="gray", background="yellow") pbstyle.configure("red.Vertical.TProgressbar", troughcolor="gray", background="orange") ttk.Label(self, text="dB").pack(side=tkinter.TOP) frame = ttk.LabelFrame(self, text="L.") frame.pack(side=tk.LEFT) self.pb_left = ttk.Progressbar(frame, orient=tk.VERTICAL, length=200, maximum=-self.lowest_level, variable=self.pbvar_left, mode='determinate', style='yellow.Vertical.TProgressbar') self.pb_left.pack() frame = ttk.LabelFrame(self, text="R.") frame.pack(side=tk.LEFT) self.pb_right = ttk.Progressbar(frame, orient=tk.VERTICAL, length=200, maximum=-self.lowest_level, variable=self.pbvar_right, mode='determinate', style='yellow.Vertical.TProgressbar') self.pb_right.pack()
Example #2
Source File: user_interface.py From open-mcr with GNU General Public License v3.0 | 7 votes |
def __init__(self, parent: tk.Tk, maximum: int): self.maximum = maximum self.value = 0 self.parent = parent pack_opts = { "fill": tk.X, "expand": 1, "padx": XPADDING, "pady": YPADDING } self.status_text = tk.StringVar(parent) pack(ttk.Label(parent, textvariable=self.status_text, width=45), **pack_opts) self.progress_bar = pack( ttk.Progressbar(parent, maximum=maximum, mode="determinate"), **pack_opts) self.close_when_changes = tk.IntVar(parent, name="Ready to Close")
Example #3
Source File: GUI.py From Scoary with GNU General Public License v3.0 | 7 votes |
def initialize_statusframe(self): """ Initialize the frame and statusbar occupying the bottom """ frame = self.bottompart frame.pb = ttk.Progressbar(frame, orient='horizontal', mode='determinate', maximum=100) frame.pb.pack(fill='both',expand=True,side='top') frame.lab = Tkinter.Label(frame,text=u"Awaiting input options") frame.lab.pack(in_=frame.pb,expand=True) #sys.stdout = StdoutToLabel(frame.lab, progressbar=frame.pb) sys.stdout = StdoutToLabel(frame.lab, progressbar=frame.pb, width=frame.cget('width'))
Example #4
Source File: preview.py From faceswap with GNU General Public License v3.0 | 7 votes |
def _add_busy_indicator(self, parent): """ Place progress bar into bottom bar to indicate when processing. Parameters ---------- parent: tkinter object The tkinter object that holds the busy indicator Returns ------- ttk.Progressbar A Progress bar to indicate that the Preview tool is busy """ logger.debug("Placing busy indicator") pbar = ttk.Progressbar(parent, mode="indeterminate") pbar.pack(side=tk.LEFT) pbar.pack_forget() self._busy_tkvar.trace("w", self._busy_indicator_trace) return pbar
Example #5
Source File: app.py From fusee-interfacee-tk with GNU General Public License v2.0 | 7 votes |
def build_widgets(self): style = ttk.Style() style.configure('Horizontal.TProgressbar', background='#5eba21') self.progress = ttk.Progressbar(self, mode='indeterminate', maximum=50) self.progress.grid(row=0, columnspan=2, sticky=tk.W+tk.E) self.progress.start(30) self.lbl_look = ttk.Label(self, text="Looking for Device...") self.lbl_look.grid(row=1, column=0, columnspan=2, pady=8) self.btn_open = ttk.Button(self, text="Select Payload", command=self.btn_open_pressed) self.btn_open.grid(row=2, column=0, padx=8) self.lbl_file = ttk.Label(self, text="No Payload Selected. ", justify=tk.LEFT) self.lbl_file.grid(row=2, column=1, padx=8) self.btn_send = ttk.Button(self, text="Send Payload!", command=self.btn_send_pressed) self.btn_send.grid(row=3, column=0, columnspan=2, sticky=tk.W+tk.E, pady=8, padx=8) self.btn_send.state(('disabled',)) # trailing comma to define single element tuple self.btn_mountusb = ttk.Button(self, text="Mount SD on PC", command=self.btn_mountusb_pressed) self.btn_mountusb.grid(row=4, column=0, columnspan=2, sticky=tk.W+tk.E, pady=8, padx=8) self.btn_mountusb.state(('disabled',)) # trailing comma to define single element tuple
Example #6
Source File: custom_widgets.py From faceswap with GNU General Public License v3.0 | 7 votes |
def _progress_bar(self): """ Place progress bar into right of the status bar. """ progressframe = ttk.Frame(self) progressframe.pack(side=tk.RIGHT, anchor=tk.E, fill=tk.X) lblmessage = ttk.Label(progressframe, textvariable=self._pbar_message) lblmessage.pack(side=tk.LEFT, padx=3, fill=tk.X, expand=True) pbar = ttk.Progressbar(progressframe, length=200, variable=self._pbar_position, maximum=100, mode="determinate") pbar.pack(side=tk.LEFT, padx=2, fill=tk.X, expand=True) pbar.pack_forget() return pbar
Example #7
Source File: gui_03.py From Modern-Python-Standard-Library-Cookbook with MIT License | 5 votes |
def __init__(self, master, text='', title=None, class_=None): super().__init__(master=master, text=text, title=title, class_=class_) self.default = None self.cancel = None self._queue = Queue() self._bar = ttk.Progressbar(self.root, orient="horizontal", length=200, mode="determinate") self._bar.pack(expand=True, fill=tkinter.X, side=tkinter.BOTTOM) self.root.attributes("-topmost", True) self.root.after(200, self._update)
Example #8
Source File: program8.py From python-gui-demos with MIT License | 5 votes |
def __init__(self, master): ttk.Label(master, text = "PROGRESS CONTROL").pack() # Inderterminant Progressbar ttk.Label(master, text = 'Inderterminant Progress').pack() self.prgrsbr_indtr = ttk.Progressbar(master, orient = tk.HORIZONTAL, length = 300, mode = 'indeterminate') self.prgrsbr_indtr.pack() self.checkpbi = tk.StringVar() self.checkpbi.set("Start") # Button self.btn1 = ttk.Button(master, text = "{} Inderterminant Progress Bar".format(self.checkpbi.get()), command = self.btn1cmd) self.btn1.pack() # Derterminant progress ttk.Label(master, text = 'Derterminant Progress').pack() self.prgrsbr_dtr = ttk.Progressbar(master, orient=tk.HORIZONTAL, length = 300, mode = 'determinate') self.prgrsbr_dtr.pack() self.prgrsbr_dtr.config(maximum = 10.0, value = 2.0) # notice both these properties have float values # Button ttk.Button(master, text = 'Reset Progress Bar to zero', command = self.resetProgressBarVal).pack() # Button ttk.Button(master, text = 'Increase Progress Bar by 2', command = self.shift2ProgressBarVal).pack() # create double variable self.prgrsBrVal = tk.DoubleVar() self.prgrsbr_dtr.config(variable = self.prgrsBrVal) # set variable property of progressbar to look at DoubleVar() # Scale widget self.scalebar = ttk.Scale(master, orient = tk.HORIZONTAL, length = 400, variable=self.prgrsBrVal, from_ = 0.0, to= 10.0) self.scalebar.pack() # Label to display current value of scalebar ttk.Label(master, text = "Current value of Progress Bar is as below:").pack() self.scalebar_label = ttk.Label(master, textvariable = self.prgrsBrVal) self.scalebar_label.pack()
Example #9
Source File: crawl.py From SEU-NewSystem-catcher with MIT License | 5 votes |
def login_start(self): global progress_var global progress_bar global progressLabel progress_var = DoubleVar() labelfont = ('times', 40, 'bold') progressLabel = Label(root, text="如果本页面长时未刷新\n请重启程序并确认账号密码验证码正确性\n反正不关我们事", pady=110) progressLabel.config(font=labelfont) progressLabel.pack() progress_bar = ttk.Progressbar(root, variable=progress_var, maximum=100) progress_bar.pack(fill=BOTH, padx=20, pady=100) pass #销毁进度条
Example #10
Source File: chapter6_04.py From Tkinter-GUI-Application-Development-Cookbook with MIT License | 5 votes |
def __init__(self): super().__init__() self.title("Progressbar example") self.queue = queue.Queue() self.progressbar = ttk.Progressbar(self, length=300, orient=tk.HORIZONTAL) self.button = tk.Button(self, text="Start", command=self.start_action) self.progressbar.pack(padx=10, pady=10) self.button.pack(padx=10, pady=10)
Example #11
Source File: running.py From thonny with MIT License | 5 votes |
def __init__(self, master, cmd, mode="indeterminate"): super().__init__(master) self.title(_("Working...")) self.response = None self._sent_interrupt = False self._mode = mode self._cmd_id = cmd["id"] description = cmd.get("description", str(cmd)) self._description_label = ttk.Label(self.main_frame, text=description) self._description_label.grid(row=0, column=0, padx=10, pady=10, sticky="new") self._progress_bar = ttk.Progressbar(self.main_frame, mode=self._mode, length=200) self._progress_bar.grid(row=1, column=0, padx=10, sticky="new") self._progress_bar.start() self._cancel_button = ttk.Button(self.main_frame, text=_("Cancel"), command=self._on_cancel) self._cancel_button.grid(row=2, column=0, padx=10, pady=10) self._start_time = time.time() if isinstance(cmd, InlineCommand): get_workbench().bind("InlineResponse", self._on_response, True) get_workbench().bind("InlineProgress", self._on_progress, True) else: raise NotImplementedError()
Example #12
Source File: ui_utils.py From thonny with MIT License | 5 votes |
def __init__(self, master, source, destination, description=None, fsync=True): self._source = source self._destination = destination self._old_bytes_copied = 0 self._bytes_copied = 0 self._fsync = fsync self._done = False self._cancelled = False self._closed = False super().__init__(master) main_frame = ttk.Frame(self) # To get styled background main_frame.grid(row=0, column=0, sticky="nsew") self.rowconfigure(0, weight=1) self.columnconfigure(0, weight=1) self.title(_("Copying")) if description is None: description = _("Copying\n %s\nto\n %s") % (source, destination) label = ttk.Label(main_frame, text=description) label.grid(row=0, column=0, columnspan=2, sticky="nw", padx=15, pady=15) self._bar = ttk.Progressbar(main_frame, maximum=os.path.getsize(source), length=200) self._bar.grid(row=1, column=0, columnspan=2, sticky="nsew", padx=15, pady=0) self._cancel_button = ttk.Button(main_frame, text=_("Cancel"), command=self._cancel) self._cancel_button.grid(row=2, column=1, sticky="ne", padx=15, pady=15) self._bar.focus_set() main_frame.columnconfigure(0, weight=1) self._update_progress() self.bind("<Escape>", self._cancel, True) # escape-close only if process has completed self.protocol("WM_DELETE_WINDOW", self._cancel) self._start()
Example #13
Source File: test_widgets.py From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 | 5 votes |
def create(self, **kwargs): return ttk.Progressbar(self.root, **kwargs)
Example #14
Source File: preview.py From faceswap with GNU General Public License v3.0 | 5 votes |
def _build_frame(self, defaults, refresh_callback, patch_callback, available_masks, has_predicted_mask): """ Build the :class:`ActionFrame`. Parameters ---------- defaults: dict The default command line options patch_callback: python function The function to execute when a patch callback is received refresh_callback: python function The function to execute when a refresh callback is received available_masks: list The available masks that exist within the alignments file has_predicted_mask: bool Whether the model was trained with a mask Returns ------- ttk.Progressbar A Progress bar to indicate that the Preview tool is busy """ logger.debug("Building Action frame") bottom_frame = ttk.Frame(self) bottom_frame.pack(side=tk.BOTTOM, fill=tk.X, anchor=tk.S) top_frame = ttk.Frame(self) top_frame.pack(side=tk.TOP, fill=tk.BOTH, anchor=tk.N, expand=True) self._add_cli_choices(top_frame, defaults, available_masks, has_predicted_mask) busy_indicator = self._add_busy_indicator(bottom_frame) self._add_refresh_button(bottom_frame, refresh_callback) self._add_patch_callback(patch_callback) self._add_actions(bottom_frame) logger.debug("Built Action frame") return busy_indicator
Example #15
Source File: soundplayer.py From synthesizer with GNU Lesser General Public License v3.0 | 5 votes |
def __init__(self, audio_source, master=None): self.lowest_level = -50 self.have_started_playing = False super().__init__(master) self.master.title("Levels") self.pbvar_left = tk.IntVar() self.pbvar_right = tk.IntVar() pbstyle = ttk.Style() pbstyle.theme_use("classic") pbstyle.configure("green.Vertical.TProgressbar", troughcolor="gray", background="light green") pbstyle.configure("yellow.Vertical.TProgressbar", troughcolor="gray", background="yellow") pbstyle.configure("red.Vertical.TProgressbar", troughcolor="gray", background="orange") frame = tk.LabelFrame(self, text="Left") frame.pack(side=tk.LEFT) tk.Label(frame, text="dB").pack() self.pb_left = ttk.Progressbar(frame, orient=tk.VERTICAL, length=300, maximum=-self.lowest_level, variable=self.pbvar_left, mode='determinate', style='yellow.Vertical.TProgressbar') self.pb_left.pack() frame = tk.LabelFrame(self, text="Right") frame.pack(side=tk.LEFT) tk.Label(frame, text="dB").pack() self.pb_right = ttk.Progressbar(frame, orient=tk.VERTICAL, length=300, maximum=-self.lowest_level, variable=self.pbvar_right, mode='determinate', style='yellow.Vertical.TProgressbar') self.pb_right.pack() frame = tk.LabelFrame(self, text="Info") self.info = tk.Label(frame, text="", justify=tk.LEFT) frame.pack() self.info.pack(side=tk.TOP) self.pack() self.open_audio_file(audio_source) self.after_idle(self.update) self.after_idle(self.stream_audio)
Example #16
Source File: internetradio.py From synthesizer with GNU Lesser General Public License v3.0 | 5 votes |
def __init__(self): super().__init__() self.wm_title("Internet radio") self.protocol("WM_DELETE_WINDOW", self.destroy) self.geometry("+200+80") self.station_buttons = [] for station in self.stations: button = tkinter.Button(self, text="\n"+station.station_name + "\n" + station.stream_name+"\n", width=14, height=8) button.pack() self.station_buttons.append(button) self.quit_button = tkinter.Button(self, text="quit", command=lambda: self.destroy()) self.quit_button.pack() self.stream_name_label = tkinter.Label(self, text="Choose a station") self.stream_name_label.pack() self.song_title_label = tkinter.Label(self, text="...") self.song_title_label.pack() self.decoder_label = tkinter.Label(self, text="...") self.decoder_label.pack() s = ttk.Style() s.theme_use("default") s.configure("TProgressbar", thickness=8) self.level_left = ttk.Progressbar(self, orient=tkinter.HORIZONTAL, length=200, maximum=61, mode="determinate") self.level_left.pack() self.level_right = ttk.Progressbar(self, orient=tkinter.HORIZONTAL, length=200, maximum=61, mode="determinate") self.level_right.pack() self.icyclient = None self.decoder = None self.play_thread = None self.after(100, self.load_button_icons)
Example #17
Source File: test_gui_solution_frame.py From pyDEA with MIT License | 5 votes |
def __init__(self, parent): super().__init__(parent) self.progress_bar = Progressbar(self, mode='determinate', maximum=100)
Example #18
Source File: main.py From mentalist with MIT License | 5 votes |
def start_progress_bar(self, path): '''Pop up a progress bar starting at 0% while the wordlist is processing ''' self.progress_path = path self.progress_popup = Tk.Toplevel() self.progress_popup.title('Processing') self.progress_popup.resizable(width=False, height=False) self.progress_popup.grab_set() self.progress_popup.overrideredirect(1) progress_frame = Tk.Frame(self.progress_popup, borderwidth=1, relief=Tk.RAISED) progress_frame.pack(side='top', fill='both', padx=10, pady=10) path_label = Tk.Label(progress_frame, text='', font=('Helvetica', '12')) path_label.pack(padx=10, pady=10) path_label.configure(text="Processing to '{}'...".format(path)) self.progress_var = Tk.DoubleVar() self.progress_bar = ttk.Progressbar(progress_frame, variable=self.progress_var, length=300, maximum=100, style='plain.Horizontal.TProgressbar') self.progress_bar.pack(side='left', padx=10, pady=10) self.progress_percent_lb = Tk.Label(progress_frame, text='', font=('Helvetica', '12')) self.progress_percent_lb.pack(side='left', padx=10, pady=10) self.progress_percent_lb.configure(text='0%') def stop(): self.controller.stop_processing_flag = True self.progress_btn = Tk.Button(progress_frame, text='Cancel', command=stop) self.progress_btn.pack(side='left', padx=10, pady=20) center_window(self.progress_popup, self.master) self.progress_popup.update()
Example #19
Source File: test.py From spotify-downloader-music-player with MIT License | 5 votes |
def songnamee(): frame1 = Frame(root, borderwidth=2, relief='ridge') frame2 = Frame(root, borderwidth=2, relief='ridge') frame3 = Frame(root, borderwidth=2, relief='ridge') frame4 = Frame(root, borderwidth=0, relief='ridge') frame5 = Frame(root, borderwidth=0, relief='ridge') frame6 = Frame(root, borderwidth=0, relief='ridge') frame1.grid(column=0, row=0, sticky="nsew") frame2.grid(column=0, row=1, sticky="nsew") frame3.grid(column=0, row=2, sticky="nsew") frame4.grid(column=1, row=0, sticky="nsew") frame5.grid(column=2, row=0, sticky="nsew") frame6.grid(column=2, row=1, sticky="nsew") menu = Menu(root) root.config(menu=menu) filemenu = Menu(menu) menu.add_cascade(label='Download Type', menu=filemenu) filemenu.add_command(label='Song Name', command=songnamee) filemenu.add_command(label='Youtube Link', command=youtubelink) filemenu.add_command(label='File', command=file) home = Button(frame1, text="HOME",width=15, command=songnamee) playlist = Button(frame2, text="PLAYLIST",width=15, command=playlistbackground) about = Button(frame3, text="ABOUT",width=15, command=aboutbackground) songName = Entry(frame4, width=40) download = Button(frame5, text="Download", command=lambda: downloadname(songName)) progress = ttk.Progressbar(frame6,orient ="horizontal",length = 200, mode ="determinate") home.pack(fill='x') playlist.pack(fill='x') about.pack(fill='x') songName.pack() download.pack() progress.pack() root.mainloop() # Function for youtube link button
Example #20
Source File: spotpl.py From spotify-downloader-music-player with MIT License | 5 votes |
def songnamee(): frame1 = Frame(root, borderwidth=2, relief='ridge') frame2 = Frame(root, borderwidth=2, relief='ridge') frame3 = Frame(root, borderwidth=2, relief='ridge') frame4 = Frame(root, borderwidth=0, relief='ridge') frame5 = Frame(root, borderwidth=0, relief='ridge') frame6 = Frame(root, borderwidth=0, relief='ridge') frame1.grid(column=0, row=0, sticky="nsew") frame2.grid(column=0, row=1, sticky="nsew") frame3.grid(column=0, row=2, sticky="nsew") frame4.grid(column=1, row=0, sticky="nsew") frame5.grid(column=2, row=0, sticky="nsew") frame6.grid(column=2, row=1, sticky="nsew") menu = Menu(root) root.config(menu=menu) filemenu = Menu(menu) menu.add_cascade(label='Download Type', menu=filemenu) filemenu.add_command(label='Song Name', command=songnamee) filemenu.add_command(label='Youtube Link', command=youtubelink) filemenu.add_command(label='File', command=file) home = Button(frame1, text="HOME",width=15, command=songnamee) playlist = Button(frame2, text="PLAYLIST",width=15, command=playlistbackground) about = Button(frame3, text="ABOUT",width=15, command=aboutbackground) songName = Entry(frame4, width=40) download = Button(frame5, text="Download", command=lambda: downloadname(songName)) progress = ttk.Progressbar(frame6,orient ="horizontal",length = 200, mode ="determinate") home.pack(fill='x') playlist.pack(fill='x') about.pack(fill='x') songName.pack() download.pack() progress.pack() root.mainloop() # Function for youtube link button
Example #21
Source File: progress_tab.py From hwk-mirror with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, **kwargs): super().__init__(parent) self._status = tk.IntVar(self) self._bar = ttk.Progressbar(parent, variable=self._status, **kwargs)
Example #22
Source File: main_gui.py From pyDEA with MIT License | 5 votes |
def create_widgets(self): ''' Creates all widgets that belong to this frame. ''' self.parent.title('pyDEA') self.pack(fill=BOTH, expand=1) self.columnconfigure(0, weight=1, pad=5) self.columnconfigure(1, weight=0, pad=5) self.rowconfigure(0, pad=3, weight=1) self.rowconfigure(1, pad=3) self.rowconfigure(2, pad=3) self.rowconfigure(3, pad=3) self.current_categories = [] data_from_params_file = StringVar() str_var_for_input_output_boxes = ObserverStringVar() self.params_frame = ParamsFrame(self, self.current_categories, data_from_params_file, str_var_for_input_output_boxes, self.weights_status_str) data_frame = DataFrame(self, self.params_frame, self.current_categories, data_from_params_file, str_var_for_input_output_boxes) self.data_frame = data_frame data_frame.grid(row=0, column=0, sticky=N+S+W+E, padx=15, pady=15) self.params_frame.grid(row=0, column=1, sticky=W+E+S+N, padx=15, pady=15, columnspan=2) lbl_progress = Label(self, text='Progress') lbl_progress.grid(row=1, column=0, sticky=W, padx=10, pady=5) self.progress_bar = Progressbar(self, mode='determinate', maximum=100) self.progress_bar.grid(row=2, column=0, sticky=W+E, padx=10, pady=5) run_btn = Button(self, text='Run', command=self.run) run_btn.grid(row=2, column=1, sticky=W, padx=10, pady=10) self.weights_status_lbl = Label(self, text='', foreground='red') self.weights_status_lbl.grid(row=2, column=2, padx=10, pady=5, sticky=W)
Example #23
Source File: solution_tab_frame_gui.py From pyDEA with MIT License | 5 votes |
def create_widgets(self): ''' Creates appropriate widgets on this frame. ''' self.columnconfigure(0, weight=1) self.rowconfigure(3, weight=1) frame_for_save_btn = Frame(self) frame_for_save_btn.columnconfigure(1, weight=1) self.status_lbl = Label(frame_for_save_btn, text='') self.status_lbl.grid(row=0, column=1, sticky=N+W) save_solution_btn = Button(frame_for_save_btn, text='Save solution', command=self.on_save_solution) save_solution_btn.grid(row=1, column=0, sticky=W+N, padx=5, pady=5) self.progress_bar = Progressbar(frame_for_save_btn, mode='determinate', maximum=100) self.progress_bar.grid(row=1, column=1, sticky=W+E, padx=10, pady=5) frame_for_save_btn.grid(sticky=W+N+E+S, padx=5, pady=5) frame_for_btns = Frame(self) self._create_file_format_btn('*.xlsx', 1, frame_for_btns, 0) self._create_file_format_btn('*.xls', 2, frame_for_btns, 1) self._create_file_format_btn('*.csv', 3, frame_for_btns, 2) self.solution_format_var.set(1) frame_for_btns.grid(row=1, column=0, sticky=W+N+E+S, padx=5, pady=5) self.data_from_file_lbl = Label(self, text=TEXT_FOR_FILE_LBL, anchor=W, justify=LEFT, wraplength=MAX_FILE_PARAMS_LBL_LENGTH) self.data_from_file_lbl.grid(row=2, column=0, padx=5, pady=5, sticky=W+N) self.solution_tab = SolutionFrameWithText(self) self.solution_tab.grid(row=3, column=0, sticky=W+E+S+N, padx=5, pady=5)
Example #24
Source File: gui.py From content-downloader with MIT License | 5 votes |
def task(ft): """ to create loading progress bar """ ft.pack(expand = True, fill = BOTH, side = TOP) pb_hD = ttk.Progressbar(ft, orient = 'horizontal', mode = 'indeterminate') pb_hD.pack(expand = True, fill = BOTH, side = TOP) pb_hD.start(50) ft.mainloop()
Example #25
Source File: gui.py From ib-historical-data with GNU General Public License v3.0 | 5 votes |
def init_gui(self): root = self.root = tki.Tk() root.title("IB History Downloader") root.minsize(280, root.winfo_height()) root.resizable(True, False) self.path = Path(root, 0, 'Output dir', './') self.file = FileName(root, 1, 'Output file', '') self.symbol = LabelEntry(root, 2, 'Symbol', '', self._onParamChange) self.endDate = LabelEntry(root, 3, 'End Date [Time]', '', self._onParamChange) self.duration = Duration(root, 4, 'Duration', self._onParamChange) self.barSize = BarSize(root, 5, 'Bar size', self._onParamChange) self.barType = BarType(root, 6, 'Data Type', self._onParamChange) self.save = ttk.Button(root, text='Save', command=self.onSave) self.save.grid(row=7, column=1, sticky=tki.NSEW) self.quit = ttk.Button(root, text='Quit', command=self.onQuit) self.quit.grid(row=7, column=2, sticky=tki.NSEW) var = tki.IntVar() self.prgrs = ttk.Progressbar(root, mode='determinate', orient=tki.HORIZONTAL, variable=var) self.prgrs.var = var self.prgrs.grid(row=8, column=0, columnspan=3, sticky=tki.NSEW) var.set(0) self._onParamChange() root.columnconfigure(0, weight=0) root.columnconfigure(1, weight=1) root.columnconfigure(2, weight=0) root.protocol("WM_DELETE_WINDOW", self.onQuit) self.checkMsgFromTws()
Example #26
Source File: test_widgets.py From Fluid-Designer with GNU General Public License v3.0 | 5 votes |
def create(self, **kwargs): return ttk.Progressbar(self.root, **kwargs)
Example #27
Source File: test_widgets.py From ironpython3 with Apache License 2.0 | 5 votes |
def create(self, **kwargs): return ttk.Progressbar(self.root, **kwargs)
Example #28
Source File: Controlador.py From proyectoDownloader with MIT License | 4 votes |
def mostrarDialogo(self): """ Método que muestra la GUI de descarga del archivo """ self.top = Toplevel(self.vista) self.top.resizable(0, 0) self.top.iconbitmap('descarga.ico') geometry = "400x150+" geometry = "400x250+" geometry += str(int(self.vista.ancho/2)-150)+"+" geometry += str(int(self.vista.alto/2)-50) self.top.geometry(geometry) self.top.title("Descarga en progreso...") self.label = Label(self.top, text="Descargando: ", font=("Arial", 13)) self.label.place(x=5, y=15) self.label2 = Label(self.top, text="Tiempo: ", font=("Arial", 13)) self.label2.place(x=130, y=15) self.label3 = Label(self.top, text="Vel.: ", font=("Arial", 13)) self.label3.place(x=250, y=15) self.progress = IntVar() self.progress.set(0) self.progressbar = ttk.Progressbar(self.top, variable=self.progress) self.progressbar.place(x=30, y=60, width=320) self.bcancelar = ttk.Button(self.top, text="Cancelar") self.bcancelar.place(x=150, y= 100) self.top.iconbitmap('descarga.ico') self.progress = IntVar() self.progress.set(0) self.progressbar = ttk.Progressbar(self.top, variable=self.progress) self.label = ttk.Label(self.top, text="Descargando: ", font=("Arial", 14)) self.label.place(x=5, y=15) self.label2 = ttk.Label(self.top, text="Tiempo restante: ", font=("Arial", 14)) self.label2.place(x=5, y=65) self.label3 = ttk.Label(self.top, text="Velocidad: ", font=("Arial", 14)) self.label3.place(x=5, y=115) self.progressbar.place(x=30, y=160, width=320) if platform.system() == 'Windows': self.vista.config(cursor="wait") self.bcancelar = ttk.Button(self.top, text="cancelar", command=self.cancelar) self.bcancelar.place(x=150,y=200) self.top.transient(self.vista) self.top.config(bg="#4C4C4D")
Example #29
Source File: __init__.py From thonny with MIT License | 4 votes |
def __init__(self, master, target_dir): self._release_info = None self._hex_url = None self._hex_size = None self._target_dir = target_dir self._bytes_copied = 0 self._state = "starting" super().__init__(master) main_frame = ttk.Frame(self) # To get styled background main_frame.grid(row=0, column=0, sticky="nsew") self.rowconfigure(0, weight=1) self.columnconfigure(0, weight=1) main_frame.columnconfigure(1, weight=1) self.title(_("Install latest MicroPython to BBC micro:bit")) target_caption_label = ttk.Label(main_frame, text=_("micro:bit location:")) target_caption_label.grid(row=0, column=0, padx=15, pady=(15, 0), sticky="w") target_label = ttk.Label(main_frame, text=self._target_dir) target_label.grid(row=0, column=1, padx=15, pady=(15, 0), sticky="w", columnspan=2) version_caption_label = ttk.Label(main_frame, text=_("Version to be installed:")) version_caption_label.grid(row=1, column=0, sticky="w", padx=15, pady=(0, 15)) self._version_label = ttk.Label(main_frame, text=_("please wait") + " ...") self._version_label.grid(row=1, column=1, columnspan=2, padx=15, pady=(0, 15), sticky="w") self._state_label = ttk.Label( main_frame, text=_("NB! All files on micro:bit will be deleted!") ) self._state_label.grid(row=2, column=0, columnspan=3, sticky="w", padx=15, pady=(0, 15)) self._progress_bar = ttk.Progressbar(main_frame, length=ems_to_pixels(30)) self._progress_bar.grid(row=3, column=0, columnspan=3, sticky="nsew", padx=15, pady=0) self._install_button = ttk.Button( main_frame, text=_("Install"), command=self._start_installing ) self._install_button.grid(row=4, column=0, columnspan=2, sticky="ne", padx=0, pady=15) self._close_button = ttk.Button(main_frame, text=_("Cancel"), command=self._close) self._close_button.grid(row=4, column=2, sticky="ne", padx=15, pady=15) self._progress_bar.focus_set() main_frame.columnconfigure(1, weight=1) self.bind("<Escape>", self._close, True) # escape-close only if process has completed self.protocol("WM_DELETE_WINDOW", self._close) self._start_downloading_release_info() self._update_state()
Example #30
Source File: gui.py From videodownloader with MIT License | 4 votes |
def create_widgets(self): tk.Label(self, text='YouTube URL/ID').grid(row=0, column=0) self.text_url = tk.Entry(self, width=60) self.text_url.grid(row=0, column=1, columnspan=2) self.btn_check_id = tk.Button(self, width=10) self.btn_check_id['text'] = 'Check Video' self.btn_check_id['command'] = self.check_video self.btn_check_id.grid(row=0, column=3) tk.Label(self, text='Output Directory').grid(row=1, column=0) self.text_output_path = tk.Entry(self, width=60, textvariable=self.output_path) self.text_output_path.grid(row=1, column=1, columnspan=2) self.btn_output_browse = tk.Button(self, width=10) self.btn_output_browse['text'] = 'Browse...' self.btn_output_browse['command'] = self.browse_output_path self.btn_output_browse.grid(row=1, column=3) tk.Label(self, text='Filename Override').grid(row=2, column=0) self.text_filename_override = tk.Entry(self, width=60, textvariable=self.filename_override) self.text_filename_override.grid(row=2, column=1, columnspan=2) tk.Label(self, text='Proxy').grid(row=3, column=0) self.text_proxy = tk.Entry(self, width=60, textvariable=self.proxy) self.text_proxy.grid(row=3, column=1, columnspan=2) tk.Label(self, text='Media Type').grid(row=4, column=0) self.radio_video_audio.append(tk.Radiobutton(self, text='Video', variable=self.audio_only, value=False, command=self.check_video)) self.radio_video_audio.append(tk.Radiobutton(self, text='Audio (Takes Longer)', variable=self.audio_only, value=True, command=self.check_video)) self.radio_video_audio[0].grid(row=4, column=1) self.radio_video_audio[1].grid(row=4, column=2) self.label_video_title = tk.Label(self) self.label_video_title.grid(row=5, column=0, columnspan=4) self.content = tk.Frame(self, relief='groove', bd=3) self.canvas = tk.Canvas(self.content, borderwidth=0, height=250, width=600) self.scrll_bar = tk.Scrollbar(self.content, orient="vertical", command=self.canvas.yview) self.frame = tk.Frame(self.canvas) self.canvas.configure(yscrollcommand=self.scrll_bar.set) self.content.grid_configure(row=6, column=0, rowspan=1, columnspan=4, sticky='NSEW') self.scrll_bar.pack(side="right", fill="y") self.canvas.pack(side='left') self.canvas.create_window((0, 0), window=self.frame, anchor="nw", tags="self.frame") self.frame.bind("<Configure>", self.on_frame_configure) self.progress_bar = ttk.Progressbar(self, orient='horizontal', length=350, mode='determinate') self.progress_bar.grid(row=7, column=1, columnspan=2) self.progress_bar['value'] = 0 self.progress_bar['maximum'] = 100 self.btn_download = tk.Button(self) self.btn_download['text'] = 'Download' self.btn_download['command'] = self.download self.btn_download.config(state=tk.NORMAL) self.btn_download.grid(row=8, column=1, columnspan=2)