因程序要求,用的python2.3/wxpython2.4做界面,出现以下问题,一直没弄明白是为什么,怎么解决,请各位指教下,谢谢。
我主要是想在窗体中用wxTreeListCtrl控件,在‘1.PNG’中的'A1‘下方展示一个TREE,在'A2'下方展示对应节点项的其它信息,我现在的问题是:
我的代码如下:
from wxPython.wx import *
from wxPython.gizmos import wxTreeListCtrl
class Frame(wx.wxFrame):
def __init__(self, *_args,**_kwargs):
wx.wxFrame.__init__(self, *_args,**_kwargs)
self.tree = wxTreeListCtrl(self, -1, pos=(10, 100), size=(1100, 800),
style=wxTR_TWIST_BUTTONS | wxTR_EXTENDED | wxTR_MULTIPLE)
# create some columns
self.tree.AddColumn("A1")
self.tree.AddColumn("A2")
self.lb_blockName = wxStaticText(self, -1, '\xd7\xe9\xc1\xa2\xc3\xfb:', pos=(10, 10))
class App(wx.wxApp):
def OnInit(self):
self.frame = Frame(NULL, -1, '123')
self.frame.Show(true)
self.SetTopWindow(self.frame)
return True
def main():
app = App()
app.MainLoop()
if __name__ == '__main__':
main()