wxTimer + XMLRPC calls: problems, help, please

Hello, wxPython users!

I have such problem:

I start wxTimer with 5000 ms, and event handler makes remote xmlrpc call, but after 5 calls my program hangs.
Can anybody help? Maybe wxTimer is not suited for that?(Should i use threads and if so, how they fit with wxPython?)

Your help is very, very appreciated.

Best regards,
Ruslan

Ruslan Spivak wrote:

Hello, wxPython users!

I have such problem:

I start wxTimer with 5000 ms, and event handler makes remote xmlrpc call, but after 5 calls my program hangs.
Can anybody help?

It's hard to say. Is it possible for your xmlrpc calls to take longer than 5 seconds? Is it possible they are blocking permanently? (Anything that runs in an event handler that can protentially take a long time will make GUI appear to hang because it is not able to respond to more events until the current handler returns.)

Maybe wxTimer is not suited for that?(Should i use threads

Probably.

and if so, how they fit with wxPython?)

It's been discussed several times on this list and also there are some pages about it in the wiki, but in a nutshell you can not call any GUI function/method from the worker threads. Instead you need to send a message from the worker to the gui thread, using events, a message queue, or simply by using wxCallAfter.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!