Skip to content

Commit 6521b7d

Browse files
Merge pull request #18 from Ebony-SYS/newproject
up to interface
2 parents 4c63436 + 4b65662 commit 6521b7d

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

04_Controle de Despesas/interface/interface.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
from tkinter import *
22
from tkinter import Tk, ttk
3+
from tkinter.ttk import Progressbar
34
from PIL import Image, ImageTk
5+
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
6+
from matplotlib.figure import Figure
7+
import matplotlib.pyplot as plt
48

59
# ---------- ROOT ------------ ↓
610
preto = '#000'
@@ -50,10 +54,35 @@
5054
padx=5, relief=RAISED, anchor=CENTER, font='Verdana 14 bold italic',
5155
bg=dark1, fg=branco, borderwidth=0)
5256
labelLogo.place(x=0, y=0)
57+
58+
5359
# __________________________ POSICIONANDO LOGO NO FRAMETOPO __________________________ ↑
5460

61+
# __________________________ BARRA DE PORCENTAGEM __________________________ ↓
5562

63+
def porcentagem():
64+
labelPorcentagem = Label(frameGrafico, text='Porcentagem de gastos', height=1, anchor=NW,
65+
font=('Verdana 12'), bg=dark1, fg=cinza)
66+
labelPorcentagem.place(x=40, y=5)
5667

68+
style = ttk.Style()
69+
style.theme_use('default')
70+
style.configure('black.Horizonal.TProgressbar', background='#59b356')
71+
style.configure('TProgressbar', thickness=20)
5772

58-
janela.mainloop()
73+
barra = Progressbar(frameGrafico, length=188, style='black.Horizontal.TProgressbar')
74+
barra.place(x=15, y=35)
75+
barra['value'] = 50
76+
77+
valor = 50
78+
79+
labelValor = Label(frameGrafico, text=f'{valor:.1f}%', anchor=NW, font=('Verdana 12'),
80+
bg=dark1, fg=cinza)
81+
labelValor.place(x=210, y=35)
5982

83+
84+
# __________________________ BARRA DE PORCENTAGEM __________________________ ↑
85+
86+
87+
porcentagem()
88+
janela.mainloop()

0 commit comments

Comments
 (0)