向 ListCtrl WxPython 中的每一行添加一个按钮
我想为 ListControl 中的每一行添加一个单选按钮/普通按钮.
I want to add a radio button / Normal button for every row in ListControl.
任何人都可以提供一些有用的提示吗?
Can anyone provide some useful hints in doing that ?
所以,我想要实现的基本功能是这样的.
So, the basic functionality I want to achieve is like this.
针对列表中添加的每个项目,我想添加一个将由用户填充的有效/无效标志.所以每一行都有一个单选按钮.
Against every item added in the list, I want to add a valid / invalid flag which will be populated by user. So every row will have one radio button.
这方面的任何信息都会有所帮助
Any information in this regard will be helpful
不,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/