wxPython - HyperTreeList 项目背景颜色不适用于整行

问题描述

我正在使用 HyperTreeList rom wxPython 来管理一些数据。

在文档中它说这种风格:

wx.TR_FULL_ROW_HIGHLIGHT    
Use this style to have the background colour and the selection highlight extend over the entire horizontal row of the tree control window.

将项目背景色应用到整行。这不会发生在我的机器上。 我在这里错过了什么?

要测试的示例代码

import wx
import wx.lib.agw.hypertreelist as HTL

class MyFrame(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self,None,title="HyperTreeList Demo")

        tree = HTL.HyperTreeList(self,agwStyle= HTL.TR_FULL_ROW_HIGHLIGHT)
        tree.AddColumn("Tree Column",width=200)
        tree.AddColumn("Column 1",width=200,flag=wx.ALIGN_LEFT)
        root = tree.AddRoot("Root")

        parent = tree.AppendItem(root,"First child")
        tree.SetItemText(parent,"Child of root",column=1)
        
        tree.SetItemBackgroundColour(parent,"#AFAFAF") 



# our normal wxApp-derived class,as usual
app = wx.App(redirect=False)
locale = wx.Locale(wx.LANGUAGE_DEFAULT)
frame = MyFrame()
app.SetTopWindow(frame)
frame.Show()
app.MainLoop()

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)