Комментарии:
i have a question,how can i make it close multiple window?
ОтветитьThank u man
ОтветитьVery nicely written, but i have a doubt, in button of main window, in the command section, you give command=popup (Calling function)
But, so far i know, to call a function, we must put a parenthesis after that, like
Command=popup()
I really like your short films :) can we have some more videos wiht tkinter series?
Ответитьfrom curses import window
from tkinter import Button, Label, Tk, Toplevel
window = Tk()
window.title("Main Window")
window.geometry("300x300")
def popup():
popupwindow = Toplevel(window)
popupwindow.title("Alert")
popupwindow.geometry("200x100")
alert = Label(popupwindow, text = "Is it right?")
button1 = Button(popupwindow, text = "Ok", command = popupwindow.destroy)
alert.pack()
button1.pack()
popupwindow.mainloop()
button = Button(window, text = "Open", command = popup)
button.pack()
window.mainloop()
Please make more videos to the Tkinter series!
ОтветитьCan you put the whole code in the comments
Ответить