Есть примерно такой скрипт:
#!/usr/bin/python3 import tkinter as tk def callback_sel(): top.destroy() root=tk.Tk() top=tk.Toplevel(root) # frames frame1=tk.Frame(top) frame2=tk.Frame(top) frame3=tk.Frame(top) # text widgets txt1=tk.Text(frame1) txt2=tk.Text(frame2) txt3=tk.Text(frame3) # button button=tk.Button(frame3,text='Выделенное',command=callback_sel) button.bind('<Return>', lambda e: callback_sel()) button.pack(side='bottom') # pack text widgets txt1.pack() txt2.pack() txt3.pack() # pack frames frame1.pack() frame2.pack() frame3.pack() top.wait_window() root.mainloop()