我想将顶层窗口放在根窗口的右侧。
像这样的→ ❏❏
This is the code for my root window
root = Tk()
root.geometry("+100+100")
root.update()
root_width = root.winfo_width()
root_height = root.winfo_height()
root_xoffset = root.winfo_x()
root_yoffset = root.winfo_y()
And this the code for my TopLevel window
newWindow = Toplevel(pady=10)
newWindow.geometry(f"+{root_width+root_xoffset}+{root_yoffset}")
您可以使用
.winfo_x()
和.winfo_width()
获取顶级窗口的偏移量。 比如:相关问题 更多 >
编程相关推荐