29 lines
1.0 KiB
Python
29 lines
1.0 KiB
Python
import tkinter as tk
|
|
|
|
class FrameInicio(tk.Frame):
|
|
def __init__(self, master=None):
|
|
super().__init__(master, bg="#1e1e1e")
|
|
|
|
self.caixas_info = [
|
|
{"titulo": "Pessoas", "quantidade": 0, "cor": "#ff9966"},
|
|
{"titulo": "Pets", "quantidade": 0, "cor": "#66c2ff"},
|
|
{"titulo": "Adoções", "quantidade": 0, "cor": "#99e699"},
|
|
]
|
|
|
|
self._criar_layout()
|
|
|
|
def _criar_layout(self):
|
|
container = tk.Frame(self, bg="#1e1e1e")
|
|
container.pack(pady=40, padx=50, fill="x")
|
|
|
|
for caixa in self.caixas_info:
|
|
frame = tk.Frame(container, bg=caixa["cor"], width=200, height=120)
|
|
frame.pack(side="left", expand=True, padx=10, pady=10, fill="both")
|
|
|
|
titulo = tk.Label(frame, text=caixa["titulo"], font=("Arial", 16, "bold"), bg=caixa["cor"], fg="white")
|
|
titulo.pack(pady=(20, 5))
|
|
|
|
valor = tk.Label(frame, text=str(caixa["quantidade"]), font=("Arial", 24), bg=caixa["cor"], fg="white")
|
|
valor.pack()
|
|
|
|
|