在 wxpython 中更新列表框? [英] Updating a listbox in wxpython?
问题描述
我在更新列表框时遇到了一些麻烦,我尝试过刷新和更新,但返回了错误.
列表框使用列表来获取其信息.它将显示列表中的初始项目.
但是,当我更新列表时(程序正在运行时),它不会实时显示更改.
如果您无法理解我的意思,请发表评论.
使用方法Set()
:
self.mylistbox.Set(listofchoices)
<块引用>
将列表框重置为选择中给出的列表——即当前的元素从列表中移除并替换为新列表.
I am having some trouble, updating a listbox, Ive tried Refresh and Update but those returned errors.
The listbox uses a list to get its information. It will show the initial items in the list.
However when i update the list (while the program is running), it will not show the changes live.
If you have difficulty understanding what I mean, please comment.
Use the method Set()
:
self.mylistbox.Set(listofchoices)
Resets the list box to the list given in choices—that is, the current elements are removed from the list and replaced by the new list.
这篇关于在 wxpython 中更新列表框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!