Toplevel là cửa sổ con. Giữ focus trên cùng bằng grab_set().
Ví dụ
# Import Tkinter
from tkinter import *
# Tạo khung
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() # Giữ focus
Label(win, text="Click the below Button to open the Popup", font=('Helvetica 18 bold')).pack(pady=30)
Button(win, text="Click Me", command=open_win, font=('Helvetica 14 bold'), foreground='OrangeRed3', background="white").pack(pady=50)
win.mainloop()Kết quả
Cửa sổ chính có nút. Click mở popup Toplevel luôn ở trên cùng.

