How to Create TopLevel Window in Tkinter 


from tkinter import *
root = Tk()
root.geometry("800x350+450+86")
root.title("Tkinter Top Level")
root.resizable(width="true", height="true")
root.config(bg="#f0f022")


def windowopentop():
top = Toplevel(root)
top.mainloop()

btn1 = Button(root, text="Window Open", command=windowopentop, font=("Times new roman", 25, "bold"))
btn1.pack(pady=60)

btn2 = Button(root, text="Exit",font=("Times new roman", 25, "bold"), command=root.quit)
btn2.pack(pady=10)
root.mainloop()

Write Down Code Your Code Editor. To show Your Output. If Use Pycharm Press Shift+F10 and Show Your Output.





Post a Comment

أحدث أقدم