1
應該怎樣做有left_margin(青色)和right_margin(品紅)框架把所有的垂直高度從top_margin到bottom_margin?模擬上,下,左,在Tkinter的包幾何右頁邊距
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()