且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

向 ListCtrl WxPython 中的每一行添加一个按钮

更新时间:2023-12-04 10:00:28

不,ListCtrl 不支持.不过,您可以通过 CheckListCtrlMixin 添加复选框.否则,您将不得不使用 UltimateListCtrl,它是纯 Python 并允许向其中添加各种小部件.如果您下载 wxPython 演示并查看演示的高级通用小部件部分,您可以看到它是如何工作的.这个小教程也可以帮助你开始和运行:http://www.blog.pythonlibrary.org/2011/11/02/wxpython-an-intro-to-the-ultimatelistctrl/

No, that is not supported by the ListCtrl. You can add a checkbox via the CheckListCtrlMixin though. Otherwise, you'll have to use the UltimateListCtrl, which is pure Python and allows all kinds of widgets to be added to it. You can see how it works if you download the wxPython demo and look in the Advanced Generic Widgets section of the demo. This little tutorial might also help you get up and running: http://www.blog.pythonlibrary.org/2011/11/02/wxpython-an-intro-to-the-ultimatelistctrl/