471,616 Members | 1,459 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

wxPython, searching, and threads

Hello! I am writing a search engine with wxPython as the GUI. As the
search thread returns items, it adds them to a Queue which is picked
up by the main GUI thread calling itself recursively with
wx.CallAfter. These are then added to a ListCtrl. This works fine for
small searches, but with larger and longer searchs the GUI is clogged
and won't respond. I suspect (I may be wrong) that there are so many
results being sent to the ListCtrl that the event loop doesn't have
time to respond to events. I've tried buffering the results before
sending them to the GIU, but that doesn't help at all. Please advise.

Jul 18 '07 #1
1 1633
On Jul 18, 11:38 am, Benjamin <musiccomposit...@gmail.comwrote:
Hello! I am writing a search engine with wxPython as the GUI. As the
search thread returns items, it adds them to a Queue which is picked
up by the main GUI thread calling itself recursively with
wx.CallAfter. These are then added to a ListCtrl. This works fine for
small searches, but with larger and longer searchs the GUI is clogged
and won't respond. I suspect (I may be wrong) that there are so many
results being sent to the ListCtrl that the event loop doesn't have
time to respond to events. I've tried buffering the results before
sending them to the GIU, but that doesn't help at all. Please advise.
The standard wxPython user's group reply to a question like this is,
check out http://wiki.wxpython.org/LongRunningTasks. I've used a
variation of what's on this page to create a fairly complex installer
than keeps a textctrl updated with its progress. Since the installer
runs for almost an hour, I think this method works great.

Admittedly, you work with threads, which is intimidating to some
degree and if you use WMI, then you'll need to use some special
commands to make it work in a thread.

The wxPython mailing list is here: http://www.wxpython.org/maillist.php

Hope that helps.

Mike

Jul 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.