To remove the borders / decoration of a window in TkInter
use the method:
.overrideredirect(True)
Example usage:
from tkinter import Tk, Label, Button
class Exemplo:
def __init__(self, aplicacao):
# Remove as bordas/decoração
aplicacao.overrideredirect(True)
#Cor de fundo como no exemplo da outra resposta
root["bg"] = "gray"
self.label = Label(aplicacao, text="Primeira janela")
self.label.pack()
self.greet_button = Button(aplicacao, text="Chamar função", command=self.minhafuncao)
self.greet_button.pack()
self.close_button = Button(aplicacao, text="Fechar", command=aplicacao.quit)
self.close_button.pack()
def minhafuncao(self):
print("Testando!")
root = Tk()
minhajanela = Exemplo(root)
root.mainloop()
Note: .overrideredirect(True)
can also be applied to a specific window / widget.
Then after applying overrideredirect
you can create your own maximize, minimize or "decoration" (borders) of your own.