私は解決できない問題を発見した。 Googleの問題に近づいてみるとここにある[Tkinter: Determine Widget Position relative to Root Windowとここ[http://web.archive.org/web/20131521010600/http://www.pythonware.com/library/tkinter/introduction/x9548-window-related-information.htm]がわかりません。私が理解するのを助けることができますか?あなたは私がtkinter GUIを書いたのを見ることができます。メインのルートウィンドウには2つのフレームがあります。上には、2つのトップレベルウィンドウを起動する2つのボタンがあります。私は下のフレームの中にトップレベルの窓を置く必要があります。そして、私がメインウィンドウのトップレベルに移動すると、それに「接着」されます。これはどうですか?どのようにトップレベルのウィンドウ
import tkinter as tk
from tkinter import Frame, Button
def toplevel1():
top=tk.Toplevel()
top.geometry("600x300+300+270")
top.overrideredirect(1)
def toplevel2():
top=tk.Toplevel()
top.geometry("600x300+300+270")
top.overrideredirect(1)
root = tk.Tk()
root.geometry("600x400+300+150")
tf = tk.Frame(root, height='100' ,width='600').pack(side='top')
bf = tk.Frame(root, height='300', width='600').pack(side='bottom')
b1 = tk.Button(tf, bg='yellow', text='Button1', command=toplevel1).place(height='100' ,width='300', x='0', y='0')
b2 = tk.Button(tf, bg='black', fg='white', text='Button2', command=toplevel2).place(height='100' ,width='300', x='300', y='0')
root.mainloop()
「チート」が1つあると思います。ボーダレスウィンドウは移動できないので、ボーダレスメインウィンドウを作成し、終了ボタンを追加する必要があります。いいアイデアですか? – guest013