2017-10-07 172 views
0

相關代碼:相關代碼:相關代碼:相關代碼:相關代碼:相關代碼:相關代碼:相關代碼:相關代碼:相關代碼:相關代碼:相關的代碼:爲什麼是工具欄在這裏工作不正常(AWS)

self.propertyListWrapper = ttk.Frame(self.propertyMenu) 
self.propertyListWrapper.pack(fill = tk.BOTH, expand = tk.YES) 
self.propertyListCanvas = tk.Canvas(self.propertyListWrapper) 
self.propertyListCanvas.pack(fill = tk.BOTH, expand = tk.YES, side = tk.LEFT) 
self.propertyGrid = ttk.Frame(self.propertyListCanvas) 
self.propertyListScrollbar = ttk.Scrollbar(self.propertyListWrapper) 
self.propertyListScrollbar.config(command = 
self.propertyListCanvas.yview) 
self.propertyListCanvas.config(yscrollcommand = 
self.propertyListScrollbar.set)  
self.propertyListScrollbar.pack(side = tk.RIGHT, fill = tk.Y) 


self.propertyListCanvas.config(scrollregion = (0, 0, 
self.propertyGrid.winfo_width(), self.propertyGrid.winfo_height())) 
self.propertyListCanvas.create_window((0,0), window = self.propertyGrid, anchor='nw') 
+0

是否滾動條變得可見?有沒有錯誤代碼? – Rob

+0

的可能的複製[與Tkinter的畫布滾動條的問題](https://stackoverflow.com/questions/27390899/issues-with-canvas-scrollbars-in-tkinter) – Rob

回答

0

對於帆布以能夠滾動幀,該幀必須被添加到與所述create_window方法畫布上。您不能使用pack

相關問題