18-Barra de Progresso:
Podemos criar uma barra de progresso da seguinte forma:
from tkinter.ttk import Progressbarbarra = Progressbar(window, length=200)
E podemos definir a porcentagem da barra com o seguinte parâmetro:
barra['value'] = 70
###############################################################
###############################################################
18.1-Mudar cor da barra de progresso:
from tkinter import *from tkinter.ttk import Progressbarfrom tkinter import ttkwindow = Tk()window.title("Ti Fora da Caixa")window.geometry('350x200')style = ttk.Style()style.theme_use('default')style.configure("red.Horizontal.TProgressbar",background='red')barra = Progressbar(window, length=200,style='red.Horizontal.TProgressbar')barra['value'] = 70barra.pack()
O resultado sera:
0 Comentários