python中treeview怎么刷新_python:tkinter treeview颜色没有更新

在使用Tkinter创建科学数据分析界面时,遇到treeview颜色无法更新的问题。通过设置tag来改变行的前景色,但代码在一台电脑上突然停止工作。尽管逻辑检查无误,且在同一版本ttk(0.3.1)下,颜色设置不起作用,而加粗操作正常。怀疑是Python包的问题,尝试了创建新环境、卸载重装anaconda和更新模块,问题依然存在。代码在另一台电脑上运行正常。最后发现可能是Python 3.7版本的bug,建议降级到Python 3.6或尝试更高版本。
摘要由CSDN通过智能技术生成

This is my first post, please excuse me if I made mistake in the format, I will gladly change it if required.

I'm creating an interface for scientific datas analysis using Tkinter. For a list of molecules, four can be represented in separate plots. On the side, I use a Treeview to show some numbers about all molecules. (not just the displayed ones) When a treeview row is about a displayed plot, i want that row's text to be the same color.

For each displayed graph, I place a different tag on the row that represents it and then use the tag method to change the foreground color to the plot's color.

The code used to work fine, but now it has stopped working without any changes to the my code. The setting of the foreground color with the tags doesn't change the color. A few lines later, I also use that method to change a row to be bold and it works fine.

I man

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值