Hello everyone,
I would like to have a custum function executed in every run of the main loop. How can I do that?
Unfortunately
all documentation on how to write a custum MainLoop, i.e. replacing wx.App.MainLoop seems to be outdated (older then 2005) and does not work
for me.
The reason is that I want to implement a simple thread save messaging system (similar to pubsub). In my main GUI thread I would
poll for new messages from within the main loop and then deliver them. Message sending would work from any thread.
Cheers,
Patrick
Personally I would just use a wx.Timer to poll for new messages. Then you don’t have deal with a custom MainLoop.
The last time I saw a thread on creating some kind of custom main loop was early this year or late last year when the fellow behind VPython wanted to integrate wxPython as VPython’s backend. Here is one of those threads:
https://groups.google.com/forum/?fromgroups#!searchin/wxpython-users/vpython/wxpython-users/IcMSyHkudNU/Hnh-UTTq52kJ
You’ll have to do a bit of digging too to find out what he did in the end. I know there was a whole series of threads and he recently released a new version of VPython with the major update…
···
On Tuesday, September 24, 2013 7:31:20 AM UTC-5, captain_error wrote:
Hello everyone,
I would like to have a custum function executed in every run of the main loop. How can I do that?
Unfortunately
all documentation on how to write a custum MainLoop, i.e. replacing wx.App.MainLoop seems to be outdated (older then 2005) and does not work
for me.
The reason is that I want to implement a simple thread save messaging system (similar to pubsub). In my main GUI thread I would
poll for new messages from within the main loop and then deliver them. Message sending would work from any thread.
Cheers,
Patrick