我用tkinter做了一个滚动的画布。当我用一个比画布大的框架通过create_window链接创建一个窗口时,窗口将与画布的边框重叠。在import Tkinter as tk
class ScrollCanvas(object):
“””A widget to show table in frame”””
def __init__(self, parent=None):
self.parent = parent
self.frame = tk.Frame(self.parent, bd=3,
relief=tk.GROOVE)
self.frame.pack(fill=tk.BOTH, expand=1)
self.frame.grid_rowconfigure(0, weight=1)
self.frame.grid_columnconfigure(0, weight=1)
self.xscrollbar = tk.Scrollbar(self.frame, orient=tk.HORIZONTAL)
self.yscrollbar = tk.Scrollbar(self.frame, orient=tk.VERTICAL)
self.canvas = tk.Canvas(self.frame, bg=’#006666′,
bd=10, relief=tk.GROOVE,
xscrollcommand=self.xscrollbar.set,
yscrollcommand=self.yscrollbar.set)
self.xscrollbar.grid(row=1, col