超级卷轴列表如何添加小部件?/如何使文本可编辑?

2024-09-29 22:32:57 发布

您现在位置:Python中文网/ 问答频道 /正文

最近我发现了Hypertreelist,它似乎是我需要的,但没有任何好的例子。所以我有几个问题:

  • 如何添加wx.小部件对吗?就像放置一个组合框
  • 如何使行中的文本可编辑?Vie双击会很好

以下是我目前的代码:

import wx
import wx.lib.agw.hypertreelist as HTL

class MyFrame(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(self, parent, -1, "HyperTreeList Demo")

        tree_list = HTL.HyperTreeList(self)
        tree_list.AddColumn("First column")
        root = tree_list.AddRoot("Root")
        parent = tree_list.AppendItem(root, "First child")
        child = tree_list.AppendItem(parent, "First Grandchild")
        tree_list.AppendItem(root, "Second child")

app = wx.App(0)
frame = MyFrame(None)
app.SetTopWindow(frame)
frame.Show()
app.MainLoop()

Tags: importselfchildtreeapprootframelist

热门问题