使用的是Python,tk,我如果在一个Frame中嵌套一个Frame,外面的Frame大小设置就失灵了。
import customtkinter
if __name__ == "__main__":
app = customtkinter.CTk()
app.geometry("300x300")
frame = customtkinter.CTkFrame(app, width=280, height=280, fg_color="red")
frame_1 = customtkinter.CTkFrame(
frame, width=20, height=20, fg_color="green", corner_radius=5
)
frame_1.pack()
frame_2 = customtkinter.CTkFrame(
frame, width=20, height=20, fg_color="blue", corner_radius=5
)
frame_2.pack()
frame.pack()
app.mainloop()
本来是想做一组小Frame在里面,然后更随窗口大小变化的。
m*n行,最后一行可能不填满这个样子。
这种问题搜得到吧, 在frame.pack()下加一行