0
關閉和打開的窗口我有一個主窗口,而這一次裏面的按鈕,我打開另一個窗口,由另一個按鈕關閉。 一旦後者關閉,你怎麼可能不能重新打開它? 我附上兩個程序的代碼。與Tkinter的
第一個程序
from tkinter import *
def funzBottoCli():import nuovaprova
root = Tk()
root.state('zoomed')
root.title("Gestionale")
bottonCli = Button(root, text=" Apertura altra finestra ", fg=('red'),
font=('arial',10,'bold'), relief='raised', command=funzBottoCli).place(x=20, y=20)
root.mainloop()
#SECOND PROGRAM
from tkinter import *
def funzBottoCli():fine_cli_ins.destroy()
fine_cli_ins = Tk()
fine_cli_ins.title("Inserimento Anagrafica Clienti")
fine_cli_ins.geometry('640x480+400+150')
form1 = Frame(fine_cli_ins, bg='red',width=640, height=50, relief='raised',
border=3).pack()
label1 = Label(fine_cli_ins, text=(" INSERIMENTO CLIENTI "), fg=('red'),
bg=('gray'),
font=('arial',16,'bold'), relief='raised').place(x=200, y=10)
bottonCli = Button(fine_cli_ins, text=" Chiusura finestra ", fg=('red'),
font=('arial',10,'bold'), relief='raised', command=funzBottoCli).place(x=260, y=400)
fine_cli_ins.mainloop()
看到此鏈接以獲取更多信息[她](http://stackoverflow.com/questions/8009176/function-to-close-the-window-in-tkinter) – 2017-04-28 09:44:10