[英]Active background color to treeview header
如何为树视图标题设置活动背景颜色。 使用以下代码,背景和前景工作正常,但活动背景不起作用。 请在这件事上给予我帮助
ttk.Style().theme_use('default')
ttk.Style().configure("Treeview.Heading",font=("Calibri",12,'italic'),activebackground="#81C44C",background = "#0D94D2",foreground="White")
您需要使用style.map
来更改行为:
pressed_color = 'black'
highlight_color='red'
ttk.Style().map("Treeview.Heading",
background = [('pressed', '!focus', pressed_color),
('active', highlight_color),
('disabled', '#ffffff')])
作为一个很好的来源
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.