टिंकर अस्थिर वर्ग में अपर्याप्त . है खिड़की जो मुख्य खिड़की के अलावा एक बाल खिड़की है। जब भी हम एक टॉपलेवल विंडो बनाते हैं, तो यह मुख्य विंडो के ऊपर उसमें परिभाषित विजेट्स के साथ दिखाई देती है।
विंडो टॉपलेवल विंडो को केंद्रित रखने के लिए, हम उपयोग कर सकते हैंgrab_set() तरीका। यह हमेशा टॉपलेवल विंडो को अन्य सभी विंडो से ऊपर रखता है।
उदाहरण
#Import the tkinter library
from tkinter import *
#Create an instance of tkinter frame
win = Tk()
win.geometry("700x350")
def open_win():
top = Toplevel(win)
top.geometry("700x250")
Label(top, text= "Hey Folks!", font= ('Helvetica 14 bold')).pack()
top.grab_set()
#Create a Label to print the Name
label= Label(win, text="Click the below Button to open the Popup", font= ('Helvetica 18 bold'))
label.pack(pady= 30)
#Create a Button
button= Button(win, text= "Click Me", command= open_win, font= ('Helvetica 14 bold'), foreground= 'OrangeRed3', background= "white")
button.pack(pady=50)
win.mainloop() आउटपुट
उपरोक्त कोड को चलाने से एक विंडो प्रदर्शित होगी जिसमें पॉपअप विंडो खोलने के लिए एक बटन होगा।

अब, पॉपअप विंडो खोलने के लिए बटन पर क्लिक करें।
