from tkinter import *
root = Tk()
root.geometry("400x400")
root.resizable(0, 0)
root.config(bg="#124f6e")
root.title("Aumento da Reforma")
titulo = Label(text="Aumento da Reforma",
font=("Arial", "27", "bold"),bg="#124f6e",fg="#13d1b1")
titulo.place(relx=0.02, rely=0.05)
texto_sub1 = Label(text="Valor da Reforma:",
font=("Arial", "15", "bold"),bg="#124f6e",fg="#13d1b1")
texto_sub1.place(relx=0.15, rely=0.3)
Valor_Reforma = DoubleVar()
Valor_Reforma_entrada = Entry(textvariable=Valor_Reforma,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Valor_Reforma_entrada.place(relx=0.64, rely=0.3, relwidth=0.27)
def limpar():
Valor_Reforma_entrada.delete(0, END)
resultado.set("")
def app():
r = Valor_Reforma.get()
valor_aumento = r*0.062
total = r+valor_aumento
mensagem =f"Valor do Aumento: {valor_aumento} €\n" \
f"Valor Total: {total} €"
resultado.set(mensagem)
but1 = Button(text="Verificar", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=app)
but1.place(relx=0.05, rely=0.5, relwidth=0.25, relheight=0.1)
but_limpar = Button(text="Limpar", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=limpar)
but_limpar.place(relx=0.35, rely=0.5, relwidth=0.25, relheight=0.1)
but_sair = Button(text="Sair", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=root.destroy)
but_sair.place(relx=0.65, rely=0.5, relwidth=0.25, relheight=0.1)
resultado = StringVar()
resultado_texto = Label(textvariable=resultado,
font=("Arial", 12, "bold"), bg="#cfe2f3")
resultado_texto.place(relx=0.05, rely=0.75, relwidth=0.9,relheight=0.15)
root.mainloop()