From: Doug H. <et...@ed...> - 2003-07-17 19:29:19
|
> My question (request, really) is, could someone post a simple example > program that uses both visual and wxPython? Hi, it probably isn't possible like he said, but here is how I combined pygame and wxpython if it is of help: WxPython has methods for communicating safely between threads, wxPostEvent and wxCallAfter. I'm using them to combine PyGame and wxPython. I start up PyGame in its own thread (similar to the 2nd example here: http://wiki.wxpython.org/index.cgi/IntegratingPyGame and the 1st example here: http://wiki.wxpython.org/index.cgi/LongRunningTasks ). When my pygame drawing code needs to read or set the value of a wxPython control, it uses wxCallAfter (actually, I have my own InvokeLater and InvokeAndWait methods like Java: http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html ). Example, instead of win.inputField.SetValue("text") something like wxCallAfter(win.inputField.SetValue, ["text"]) |