展开全部
用wx.lib.agw.customtreectrl,下面的代码e69da5e887aa62616964757a686964616f31333337376331没有添加事件,具体可参阅文档。01.#coding=utf-8
02.import wx
03.import wx.lib.agw.customtreectrl as CT
04.
05.class MyFrame(wx.Frame):
06. def __init__(self, parent):
07. wx.Frame.__init__(self, parent, -1, "CustomTreeCtrl")
08. self.custom_tree = CT.CustomTreeCtrl(self, agwStyle=wx.TR_DEFAULT_STYLE)
09. root = self.custom_tree.AddRoot(u"根选项")
10.
11. for y in range(5):
12. item = self.custom_tree.AppendItem(root, u"选项%d" % y, ct_type=1)
13.
14.app = wx.PySimpleApp()
15.frame = MyFrame(None)
16.app.SetTopWindow(frame)
17.frame.Show()
18.app.MainLoop()