活动背景颜色为Treeview标头 [英] Active background color to treeview header

查看:89
本文介绍了活动背景颜色为Treeview标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置树视图标题的活动背景色.使用以下代码,背景和前景工作正常,但活动背景不工作.请帮助我

How to set the active background color for the treeview heading. used the following code, background and foreground is working fine but active background is not working. please help me with this

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

作为良好的来源

这篇关于活动背景颜色为Treeview标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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