Adding a button to every row in ListCtrl WxPython

天涯浪子 提交于 2020-01-07 02:44:31

问题


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


回答1:


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/



来源:https://stackoverflow.com/questions/15466244/adding-a-button-to-every-row-in-listctrl-wxpython

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!