Why is the toolbar working improperly in here(AWS)

。_饼干妹妹 提交于 2019-12-13 02:59:09

问题


Relevant code:Relevant code:Relevant code:Relevant code:Relevant code:Relevant code:Relevant code:Relevant code:Relevant code:Relevant code:Relevant code:Relevant code:

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')

回答1:


For the canvas to be able to scroll the frame, the frame must be added to the canvas with the create_window method. You can't use pack.



来源:https://stackoverflow.com/questions/46624488/why-is-the-toolbar-working-improperly-in-hereaws

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!