How to change background/foreground of item in Treeview by tag?

后端 未结 2 470
鱼传尺愫
鱼传尺愫 2021-01-23 06:37

I want to apply different background for tags in Treeview but when I set tag for example as \"minus\" and try to configure tag to have black background it stills returns white b

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-23 07:10

    I'm quite sure that the 'tags' keyword must get a tuple instead of a string, to force the conversion, just write 'minus' like ('minus',) instead.

    Edit: Documentation actually says that the 'tags' keyword should actually get a list, but i've seen lots of examples that supply a tuple. I suppose that this is due to the fact that a tuple can be parsed to a list.

提交回复
热议问题