当前位置: 首页>>代码示例>>Python>>正文


Python ttk.Progressbar方法代码示例

本文整理汇总了Python中ttk.Progressbar方法的典型用法代码示例。如果您正苦于以下问题:Python ttk.Progressbar方法的具体用法?Python ttk.Progressbar怎么用?Python ttk.Progressbar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ttk的用法示例。


在下文中一共展示了ttk.Progressbar方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
def __init__(self, master):
        ttk.Frame.__init__(self, master)
        self.pack()

        ttk.Label(self, text="This is an 'indeterminate' progress bar").pack(padx=20, pady=10)

        progress1 = ttk.Progressbar(self, orient='horizontal', length=500, mode='indeterminate')
        progress1.pack(padx=20, pady=10)

        ttk.Label(self, text="This is a 'determinate' progress bar").pack(padx=20, pady=10)

        progress2 = ttk.Progressbar(self, orient='horizontal', length=500, mode='determinate')
        progress2.pack(padx=20, pady=10)

        progress1.start()
        progress2.start() 
开发者ID:brysontyrrell,项目名称:MacAdmins-2016-Craft-GUIs-with-Python-and-Tkinter,代码行数:18,代码来源:Tkinter_Widget_Examples.py

示例2: initialize_statusframe

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
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')) 
开发者ID:AdmiralenOla,项目名称:Scoary,代码行数:20,代码来源:GUI.py

示例3: login_start

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
def login_start(self):
    global progress_var
    global progress_bar
    global progressLabel
    progress_var = DoubleVar()
    labelfont = ('times', 40, 'bold')
    progressLabel = Label(root, text="正在登录选课系统...", 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 
开发者ID:LeonidasCl,项目名称:seu-jwc-catcher,代码行数:14,代码来源:main.py

示例4: create

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
def create(self, **kwargs):
        return ttk.Progressbar(self.root, **kwargs) 
开发者ID:aliyun,项目名称:oss-ftp,代码行数:4,代码来源:test_widgets.py

示例5: task

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
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() 
开发者ID:nikhilkumarsingh,项目名称:content-downloader,代码行数:11,代码来源:gui.py

示例6: create_widgets

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
def create_widgets(self):

        frame_master = Frame(self.window, padding = 5)

        label_message = Label(frame_master, text = self.message)
        label_message.pack()

        self.progress = ttk.Progressbar(frame_master, mode = self.mode, orient="horizontal", length = 300)
        self.progress.pack()
        self.progress['maximum'] = self.maximum

        frame_master.pack() 
开发者ID:lukas2511,项目名称:sky3ds.py,代码行数:14,代码来源:gui.py

示例7: initialize_UI

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
def initialize_UI(self):


		if not self.move_range:
			self.move_range=range(1,self.max_move+1)



		root = self
		root.title('GoReviewPartner')
		root.protocol("WM_DELETE_WINDOW", self.close)

		bg=root.cget("background")
		logo = Canvas(root,bg=bg,width=5,height=5)
		logo.pack(fill=BOTH,expand=1,side=LEFT)
		logo.bind("<Configure>",lambda e: draw_logo(logo,e,"vertical"))

		right_frame=Frame(root)
		right_frame.pack(side=LEFT,padx=5, pady=5)
		self.right_frame=right_frame
		Label(right_frame,text=_("Analysis of: %s")%os.path.basename(self.filename)).pack()

		self.lab1=Label(right_frame)
		self.lab1.pack()

		self.lab2=Label(right_frame)
		self.lab2.pack()

		self.lab1.config(text=_("Currently at move %i/%i")%(1,self.max_move))

		self.pb = ttk.Progressbar(right_frame, orient="horizontal", length=250,maximum=self.max_move+1, mode="determinate")
		self.pb.pack()

		try:
			write_rsgf(self.rsgf_filename,self.g)
		except Exception,e:
			self.lab1.config(text=_("Aborted"))
			self.lab2.config(text="")
			raise e 
开发者ID:pnprog,项目名称:goreviewpartner,代码行数:41,代码来源:toolbox.py

示例8: __init__

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
def __init__(self, master, count):
        tk.Frame.__init__(self, master, borderwidth=5, relief='groove')
        self.grid(row=0, column=0)

        tk.Label(self, text="Your files are being uploaded").pack(padx=15, pady=10)

        self.progress = ttk.Progressbar(self, orient='horizontal', length=250, mode='determinate')
        self.progress.pack(padx=15, pady=10)
        self.progress['value'] = 0
        self.progress['maximum'] = count 
开发者ID:brysontyrrell,项目名称:MacAdmins-2016-Craft-GUIs-with-Python-and-Tkinter,代码行数:12,代码来源:06_File_Uploader.py

示例9: create_console_frame

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
def create_console_frame(self):
		cnslfrm = Frame(self.root)
		photo = PhotoImage(file='icons/glassframe.gif')
		self.canvas = Canvas(cnslfrm, width=370, height=90)
		self.canvas.image = photo
		self.canvas.grid(row=1)
		self.console = self.canvas.create_image(0, 10, anchor=NW, image=photo)
		self.clock = self.canvas.create_text(32, 34, anchor=W, fill='#CBE4F6', font="DS-Digital 20", text="00:00")
		self.songname = self.canvas.create_text(115, 37, anchor=W, fill='#9CEDAC', font="Verdana 10", 
			text='\"Currently playing: none[00.00]\"')
		self.progressBar =  ttk.Progressbar(cnslfrm, length=1, mode="determinate")
		self.progressBar.grid(row=2, columnspan=10, sticky=W+E, padx=5)

		cnslfrm.grid(row=0, padx=0, pady=1) 
开发者ID:Leohc92,项目名称:Tkinter-Projects,代码行数:16,代码来源:main-gui.py

示例10: __init__

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
def __init__(self, base):
        # Base Frame Configuration
        self.base = base
        base.title("PcapXray")
        Label(base, text="PcapXray Tool - A LAN Network Analyzer")

        # Style Configuration
        style = ttk.Style()
        style.configure("BW.TLabel", foreground="black")
        style.configure("BW.TEntry", foreground="black")

        # 1st Frame - Initial Frame
        InitFrame = ttk.Frame(base,  width=50, padding="10 10 10 10",relief= GROOVE)
        InitFrame.grid(column=10, row=10, sticky=(N, W, E, S))
        InitFrame.columnconfigure(10, weight=1)
        InitFrame.rowconfigure(10, weight=1)

        # Pcap File Entry
        self.pcap_file = StringVar()
        self.filename = ""
        ttk.Label(InitFrame, text="Enter pcap file path: ",style="BW.TLabel").grid(column=0, row=0, sticky="W")
        self.filename_field = ttk.Entry(InitFrame, width=30, textvariable=self.pcap_file, style="BW.TEntry").grid(column=1, row=0, sticky="W, E")
        self.progressbar = ttk.Progressbar(InitFrame, orient="horizontal", length=200,value=0, maximum=200,  mode="indeterminate")
        # Browse button
        #self.filename = StringVar()
        ttk.Button(InitFrame, text="Browse", command=self.browse_directory).grid(column=2, row=0, padx=10, pady=10,sticky="E")
        ttk.Button(InitFrame, text="Analyze!", command=self.pcap_analyse).grid(column=3, row=0, padx=10, pady=10,sticky="E")
        self.progressbar.grid(column=4, row=0, padx=10, pady=10, sticky="E")

        # Second Frame with Options
        SecondFrame = ttk.Frame(base,  width=50, padding="10 10 10 10",relief= GROOVE)
        SecondFrame.grid(column=10, row=20, sticky=(N, W, E, S))
        SecondFrame.columnconfigure(10, weight=1)
        SecondFrame.rowconfigure(10, weight=1)
        ttk.Label(SecondFrame, text="Options: ", style="BW.TLabel").grid(row=10,column=0,sticky="W")
        self.option = StringVar()
        self.options = {'All','HTTP','HTTPS','Tor','Malicious'}
        #self.option.set('Tor')
        ttk.OptionMenu(SecondFrame,self.option,"Select",*self.options).grid(row=10,column=1,sticky="W")
        self.zoom = [900,900]
        self.img = ""
        ttk.Button(SecondFrame, text="zoomIn", command=self.zoom_in).grid(row=10,column=10,padx=5,sticky="E")
        ttk.Button(SecondFrame, text="zoomOut", command=self.zoom_out).grid(row=10,column=11,sticky="E")

        # Third Frame with Results and Descriptioms
        self.ThirdFrame = ttk.Frame(base,  width=100, height=100, padding="10 10 10 10",relief= GROOVE)
        description = """It is a tool aimed to simplyfy the network analysis and speed the process of analysing the network traffic.\nThis prototype aims to accomplish 4 important modules,
                        \n 1. Web Traffic\n 2. Tor Traffic \n 3. Malicious Traffic \n 4. Device/Traffic Details\n\nPlease contact me @ spg349@nyu.edu for any bugs or problems !
                      """
        self.label = ttk.Label(self.ThirdFrame, text="Description: \nPcapXray tools is an aid for Network Forensics or Any Network Analysis!\n"+description, style="BW.TLabel")
        self.label.grid(column=10, row=10,sticky="W")
        self.xscrollbar = Scrollbar(self.ThirdFrame, orient=HORIZONTAL)
        self.xscrollbar.grid(row=100, column=0, sticky=E + W)
        self.yscrollbar = Scrollbar(self.ThirdFrame, orient=VERTICAL)
        self.yscrollbar.grid(row=0, column=100, sticky=N + S)
        self.ThirdFrame.grid(column=10, row=30, sticky=(N, W, E, S))
        self.ThirdFrame.columnconfigure(0, weight=1)
        self.ThirdFrame.rowconfigure(0, weight=1)
        self.name_servers = "" 
开发者ID:Srinivas11789,项目名称:PcapXray,代码行数:61,代码来源:userInterface.py

示例11: __init__

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
def __init__(self, frame, url, directory, min_file_size, max_file_size, no_redirects):
		global i_max
		global file_name
		global parallel

		self.url = url
		self.directory = directory
		self.min_file_size = min_file_size
		self.max_file_size = max_file_size
		self.no_redirects = no_redirects
		self.frame = frame

		self.progress = []
		self.str = []
		self.label = []
		self.bytes = []
		self.maxbytes = []
		self.thread = []

		if parallel:
			self.length = len(self.url) 
		else:
			# to serialize just make a single thread
			self.length = 1 

		# for parallel downloading
		for self.i in range(0, self.length):
			file_name.append("")
			i_max.append(0)
			total_chunks.append(0)

			# initialize progressbar
			self.progress.append(ttk.Progressbar(frame, orient="horizontal", 
								 length=300, mode="determinate"))
			self.progress[self.i].pack()
			self.str.append(StringVar())
			self.label.append(Label(frame, textvariable=self.str[self.i], width=40))
			self.label[self.i].pack()
			self.progress[self.i]["value"] = 0
			self.bytes.append(0)
			self.maxbytes.append(0)

		# start thread
		self.start() 
开发者ID:nikhilkumarsingh,项目名称:content-downloader,代码行数:46,代码来源:gui_downloader.py

示例12: _create_widgets

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
def _create_widgets(self):
        # storage for widgets so we don't pollute GUI app instance namespace
        widget_space = collections.namedtuple('WidgetSpace', [
            'button_text',
            'button',
            'label_frame',
            'label_text',
            'label',
            'progress_bar',
            'status_label_text',
            'status_label'
        ])

        button_text = tk.StringVar(value='Start')
        button = ttk.Button(self, textvariable=button_text, command=self._start)
        button.pack()

        label_frame = ttk.LabelFrame(self, text='Service:Region')
        label_frame.pack(fill='x')

        label_text = tk.StringVar()
        label = ttk.Label(label_frame, anchor='w', textvariable=label_text)
        label.pack(fill='x')


        #XXX: add small fraction to max so progress bar doesn't wrap when work finishes
        progress_bar = ttk.Progressbar(
            self,
            orient='horizontal',
            length=self.master.winfo_screenwidth()/5,
            mode='determinate',
            maximum=self.work_count+1e-10
        )
        progress_bar.pack(fill='both')

        status_label_text = tk.StringVar(value='0 / {}'.format(self.work_count))
        status_label = ttk.Label(self, anchor='w', textvariable=status_label_text)
        status_label.pack(fill='x')

        return widget_space(button_text,
                            button,
                            label_frame,
                            label_text,
                            label,
                            progress_bar,
                            status_label_text,
                            status_label) 
开发者ID:nccgroup,项目名称:aws-inventory,代码行数:49,代码来源:progress.py

示例13: init_scales

# 需要导入模块: import ttk [as 别名]
# 或者: from ttk import Progressbar [as 别名]
def init_scales(self, vol):
        """
        """
        self.slice1 = vol.shape[0]//2
        self.slice2 = vol.shape[1]//2
        self.slice3 = vol.shape[2]//2
        x_size, y_size, z_size = vol.shape

        self.Scale1 = tk.Scale(self.Frame10, from_=0.0, to=z_size)
        self.Scale1.place(relx=0.871, rely=0.025, relwidth=0.0, relheight=0.942
                , width=46, bordermode='ignore')
        self.Scale1.configure(activebackground="#f9f9f9")
        self.Scale1.configure(command=self.AxialScroll)
        self.Scale1.configure(length="368")
        self.Scale1.configure(troughcolor="#d9d9d9")


        self.Scale2 = tk.Scale(self.Frame11, from_=0.0, to=y_size)
        self.Scale2.place(relx=0.871, rely=0.025, relwidth=0.0, relheight=0.942
                , width=46, bordermode='ignore')
        self.Scale2.configure(activebackground="#f9f9f9")
        self.Scale2.configure(command=self.SagitalScroll)
        self.Scale2.configure(digits="50")
        self.Scale2.configure(length="368")
        self.Scale2.configure(troughcolor="#d9d9d9")


        self.Scale3 = tk.Scale(self.Frame12, from_=0.0, to=x_size)
        self.Scale3.place(relx=0.871, rely=0.025, relwidth=0.0, relheight=0.942
                , width=46, bordermode='ignore')
        self.Scale3.configure(activebackground="#f9f9f9")
        self.Scale3.configure(command=self.CorronalScroll)
        self.Scale3.configure(length="368")
        self.Scale3.configure(troughcolor="#d9d9d9")


        self.TProgressbar1 = ttk.Progressbar(self.Frame2)
        self.TProgressbar1.place(relx=0.007, rely=0.948, relwidth=0.981
                , relheight=0.0, height=19)
        self.TProgressbar1.configure(variable=self.progress_bar)

        self.overlay_flag = False


    # ================================================================= 
开发者ID:koriavinash1,项目名称:DeepBrainSeg,代码行数:47,代码来源:DeepBrainSegUI.py


注:本文中的ttk.Progressbar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。