问题描述
是否有一个方法可以返回 wxPython listBox 中包含的项目列表?
Is there a single method that returns the list of items contained in a wxPython listBox?
我似乎在文档中的任何地方或任何地方都找不到任何东西.我能想到的就是将选择设置为所有项目,然后获取选定的项目,尽管这似乎是一种丑陋的迂回方式来做一些应该简单的事情.
I cant seem to find anything anywhere in the documentation or anywhere for that matter. All that I can think to do is to set the selection to all of the items and then get the selected items, though seems like an ugly roundabout way of doing something that should be simple.
更新:
正如 jeremy 所指出的,这样做的方法是使用 GetStrings()
As pointed out by jeremy the way to do this is with GetStrings()
例如
listBoxList = yourListBox.GetStrings()
推荐答案
wx.ListBox 派生自 wx.ControlWithitems.我认为 GetStrings() 是您所需要的.
wx.ListBox is derived from wx.ControlWithitems. I think GetStrings() is what you need.
这篇关于如何从 wxpython ListBox 获取项目列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)