如何解决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 举报,一经查实,本站将立刻删除。