根据标题,这可能吗?
通过三态,我的意思是父节点是:
我之前在C#中使用过它们但是找不到wxPython的等效控件/实现。
答案 0 :(得分:3)
我试图用CustomTreeCtrl
做同样的事情,它确实支持三态复选框。
创建根目录时,
self.root= self.tree.AddRoot("root node",ct_type=1)
或子节点
child= self.tree.AppendItem(parent,"child",ct_type=1)
它返回一个GenericTreeItem
对象,您可以将属性_is3State
更改为True,
self.root.Set3State(True)
或
child.Set3State(True)
答案 1 :(得分:2)
你看过wx.lib.agw.CustomTreeCtrl了吗?
我不确定它是否开箱即用,但它是用Python编写的,所以扩展它应该很容易。