开发者

Wxpython textctrl sluggish when using SetStringItem on a loop

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜