import Tkinter as tk
class GUI(tk.Tk):
def __init__(self):
tk.Tk.__init__(self)
self.canvas=tk.Canvas(self,scrollregion=(0,0,1000,1000))
self.canvas.grid()
self.canvas.create_line(0,0,1000,1000)
self.scroll=tk.Scrollbar(self,orient=tk.HORIZONTAL,command=self.canvas.xview)
self.scroll.grid()
GUI().mainloop()
滚动条似乎太短,如何使用网格布局类更改其长度?