I am using wxHaskell to show a simple window with a button. A click on
the button begins a task which takes a screenshot of the screen, does
some computation on it and then simulates mouse clicks.
Currently this task runs in the main wx thread, which makes the button
unnecessarily unnresponsive for some time.

Ideally I would like to be able to run this task in a separate thread
and only send the GUI related code to execute on the main thread. I can
not run GUI related code on a different thread, because wx, like most
GUI libraries, is not thread safe.

On wxPython documentation I read that this could be possible with
events, however I could not find anything in wxHaskell which corresponds
to creating new custom events and wx.postEvent method, which fires the
event to the main thread. This method is described here:

So my question is whether it is possible to do it in the way as
described in the wiki above or do you have a different solution to my

Thank you,
Grzegorz Milka

Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
wxhaskell-users mailing list

Reply via email to