必须要先使用pack()布局后再使用place绝对布局
import tkinter as tk
# ----------------------------------------
window1 = tk.Tk()
window1.title('定位器窗口')
window1.geometry('1000x700')
# ---------------------------------------
frame1=tk.Frame()
frame1=tk.Frame(window1,width=600,height=400,borderwidth=10,padx=0,pady=0, relief="sunken")
frame1.pack()
frame1.place(x=0,y=0)
# ----------------------------------------
frame2=tk.Frame()
frame2=tk.Frame(window1,width=400,height=400,borderwidth=10,padx=0,pady=0, relief="sunken")
frame2.pack()
frame2.place(x=600,y=0)
# ----------------------------------------
frame3=tk.Frame()
frame3=tk.Frame(window1,width=1000,height=300,borderwidth=10,padx=0,pady=0, relief="sunken")
frame3.pack()
frame3.place(x=0,y=400)
# ----------------------------------------
window1.resizable(0, 0)
window1.mainloop()
设计图一布局
图一
效果如下:
参考资料: