为什么工具栏在这里无法正常工作(AWS) [英] Why is the toolbar working improperly in here(AWS)

查看:55
本文介绍了为什么工具栏在这里无法正常工作(AWS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

相关代码:相关代码:相关代码:相关代码:相关代码:相关代码:相关代码:相关代码:相关代码:相关代码:相关代码:相关代码:

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

推荐答案

为使画布能够滚动框架,必须使用create_window方法将该框架添加到画布中.您不能使用pack.

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.

这篇关于为什么工具栏在这里无法正常工作(AWS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆