Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
tree.GetSelection() 给出实际的树 id 对象。
我想得到一个 int 的选择,就像 listbox.GetSelection() 会返回一样。
有谁知道如何做到这一点?
TreeItemId对象应该有一个方法,该GetID方法将在树中返回其 id
TreeItemId
GetID
树控件有一个内置功能来存储有关树项目的附加信息。
item= self.tree.GetSelection() self.tree.SetPyData(item,{"Source":"C:\hi.png","Opacity":1}) print self.tree.GetPyData(item)