【发布时间】:2016-07-18 08:56:20
【问题描述】:
应该怎么做才能让 left_margin (cyan) 和 right_margin (magenta) 帧全部垂直从 top_margin 到 bottom_margin 的高度?
import Tkinter as tk
root = tk.Tk()
top_margin = tk.Frame(root, height=32, background='red')
left_margin = tk.Frame(root, background='cyan')
sheet_area = tk.Frame(root, background='white')
right_margin = tk.Frame(root, background='magenta')
bottom_margin = tk.Frame(root, height=32, background='blue')
top_margin.pack(side=tk.TOP, expand=tk.YES, fill=tk.X, anchor=tk.N)
bottom_margin.pack(side=tk.BOTTOM, expand=tk.YES, fill=tk.X, anchor=tk.S)
left_margin.pack(side=tk.LEFT, expand=tk.YES, fill=tk.BOTH)
right_margin.pack(side=tk.RIGHT, expand=tk.YES, fill=tk.BOTH)
root.mainloop()
【问题讨论】: