tree.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:GRIPy 作者: giruenf 项目源码 文件源码
def __init__(self, controller_uid):
        UIViewBase.__init__(self, controller_uid)
        UIM = UIManager()
        controller = UIM.get(self._controller_uid)
        parent_controller_uid = UIM._getparentuid(self._controller_uid)
        parent_controller =  UIM.get(parent_controller_uid)  

        wx.TreeCtrl.__init__(self, parent_controller.view, -1, wx.Point(0, 0), wx.Size(200, 250),
                           wx.TR_DEFAULT_STYLE | wx.NO_BORDER)

        self._rootid = self.AddRoot(wx.EmptyString)                  
        self._set_project_name() 

        self.SetItemData(self._rootid, (controller._PSEUDOROOTUID, None))

        self.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.on_rightclick)     

        '''
        imglist = wx.ImageList(16, 16, True, 2)
        imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16,16)))
        tree.AssignImageList(imglist)
        items.append(tree.AppendItem(root, "Item 1", 0))
        '''
        parent_controller.view._mgr.AddPane(self, wx.aui.AuiPaneInfo().Name("tree").
                Caption("Object Manager").Left().Layer(1).Position(1).
                PinButton(True).MinimizeButton(True).
                CloseButton(False).MaximizeButton(True)
        )        
        parent_controller.view._mgr.Update()

        self.Bind(wx.EVT_TREE_BEGIN_DRAG, self._on_begin_drag)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号