开发者

Wxpython textctrl sluggish when using SetStringItem on a loop

开发者 https://www.devze.com 2023-02-18 13:11 出处:网络
In wxpython, To update a series of items on a textCtrl widget, I am using: for i in LARGELIST: list.SetStringItem(i, 1, str(a))

In wxpython,

To update a series of items on a textCtrl widget, I am using:

for i in LARGELIST:
    list.SetStringItem(i, 1, str(a))

This works, but just like in an excel macro - which becomes sluggish if you allow it to display every single update on the screen instead of disabling it and refreshing the spreadsheet later on - I am finding the experience sluggish as each individual cell update triggers a refresh of the form.

Ho开发者_JAVA技巧w can I make it so that the values are only updated on the screen when the loop ends?

Thank you very much


use:

window.Freeze()
for i in LARGELIST:
    list.SetStringItem(i, 1, str(a))
window.Thaw()

where "window" is the reference to your window

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号