Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python _tkinter.TclError:未找到布局PViewStyle_Python_Python 3.x_Tkinter_Treeview - Fatal编程技术网

Python _tkinter.TclError:未找到布局PViewStyle

Python _tkinter.TclError:未找到布局PViewStyle,python,python-3.x,tkinter,treeview,Python,Python 3.x,Tkinter,Treeview,我很难为我的Treeview小部件定义样式 newT=ttk.Style() newT.configure('PViewStyle', rowheight=100) PatrolView = ttk.Treeview(PatrolOverview,style='PViewStyle') 但这会带来收益 _tkinter.TclError: Layout PViewStyle not found 我得到了相同的错误:)。问题是,在tkinter中,名称样式必须是正确名称样式的结尾 小部

我很难为我的Treeview小部件定义样式

newT=ttk.Style() 
newT.configure('PViewStyle', rowheight=100) 
PatrolView = ttk.Treeview(PatrolOverview,style='PViewStyle') 
但这会带来收益

_tkinter.TclError: Layout PViewStyle not found
我得到了相同的错误:)。问题是,在tkinter中,名称样式必须是正确名称样式的结尾

小部件类样式名称
按钮t按钮
检查按钮检查按钮
组合框t组合框
进入第十天

树视图树视图(不是TTreview!)


在您的情况下,您需要将样式命名为PViewStyle.Treeview

将代码更改为:

newT=ttk.Style() 
newT.configure('PViewStyle.Treeview', rowheight=100) 
PatrolView = ttk.Treeview(PatrolOverview,style='PViewStyle.Treeview') 

样式的名称遵循规则
PViewStyle.Treeview
。方法必须以
.Treeview
结尾。