i want to make a treelist by using Boa Constructor.
first, i make a new frame, and then add a new treelist in the frame, but i can not find any key or table to let me add items in the treelist.
so i typed several Python code in the source.
However, a error message came out when i came to "Frame Designer" as this:
"Name error: name 'root' is not defined"
this is my whole code
#Boa:Frame:Frame1
import wx
def create(parent):
return Frame1(parent)
[wxID_FRAME1, wxID_FRAME1TREECTRL1,
] = [wx.NewId() for _init_ctrls in range(2)]
class Frame1(wx.Frame):
def _init_ctrls(self, prnt):
# generated method, don't edit
wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt,
pos=wx.Point(561, 187), size=wx.Size(400, 492),
style=wx.DEFAULT_FRAME_STYLE, title='Frame1')
self.SetClientSize(wx.Size(392, 458))
self.treeCtrl1 = wx.TreeCtrl(id=wxID_FRAME1TREECTRL1, name='treeCtrl1',
parent=self, pos=wx.Point(224, 104), size=wx.Size(100, 80),
style=wx.TR_HAS_BUTTONS)
root = self.tree.AddRoot("Example")
items = ["test1","test2","test3"]
self.AddTreeNodes(root, items)
def __init__(self, parent):
self._init_ctrls(parent)