टिंकर टॉपलेवल विंडो मुख्य विंडो के अलावा एक अतिरिक्त विंडो बनाती है। हम नई बनाई गई शीर्ष-स्तरीय विंडो में विजेट और घटक जोड़ सकते हैं। यह पैरेंट या मुख्य विंडो के सभी गुणों का समर्थन करता है।
कभी-कभी टॉपलेवल विंडो को चाइल्ड विंडो भी कहा जाता है। चाइल्ड विंडो को पैरेंट विंडो के सामने रखने के लिए, हम wm_transient() का उपयोग कर सकते हैं विधि।
उदाहरण
# Import the required libraries
from tkinter import *
from tkinter import ttk
# Create an instance of tkinter frame or window
win=Tk()
# Set the size of the window
win.geometry("700x350")
win.title("Parent Window")
# Create a Toplevel window
top=Toplevel(win)
top.geometry('600x250')
top.title("Child Window")
# Place the toplevel window at the top
top.wm_transient(win)
win.mainloop() आउटपुट
यदि हम उपरोक्त कोड चलाते हैं, तो यह मुख्य विंडो के सामने एक टॉपलेवल विंडो प्रदर्शित करेगा।
