在 wxpython 中更新列表框? [英] Updating a listbox in wxpython?

查看:31
本文介绍了在 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆