wxPython, searching, and threads

Discussion in 'Python' started by Benjamin, Jul 18, 2007.

  1. Benjamin

    Benjamin Guest

    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.
    Benjamin, Jul 18, 2007
    #1
    1. Advertising

  2. Benjamin

    Guest

    On Jul 18, 3:15 pm, Benjamin <> wrote:
    > 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.


    I think what you need to look at is http://wiki.wxpython.org/LongRunningTasks

    That's what the people on the wxPython list usually recommend when
    doing what you're doing. I've used the techniques there and they work
    great!

    Mike
    , Jul 19, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Zunbeltz Izaola

    threads and exception in wxPython

    Zunbeltz Izaola, Nov 2, 2004, in forum: Python
    Replies:
    24
    Views:
    858
    Peter Hansen
    Nov 4, 2004
  2. fooooo
    Replies:
    5
    Views:
    896
    Paul Rubin
    May 3, 2005
  3. Jp Calderone
    Replies:
    1
    Views:
    1,342
    Paul Rubin
    May 24, 2005
  4. Benjamin

    wxPython, searching, and threads

    Benjamin, Jul 18, 2007, in forum: Python
    Replies:
    1
    Views:
    244
  5. stumblng.tumblr
    Replies:
    1
    Views:
    202
    stumblng.tumblr
    Feb 4, 2008
Loading...

Share This Page