Combinging wxPython and engine in DLL
Jorgen Bodde
jorgen.maillist at gmail.com
Fri Jan 5 04:22:17 PST 2007
Hi Guys,
Slightly OT but I wish to use wxPython for my GUI so I guess it's
allright, and all the best Python guru's are here amyway ;-)
This is the situation, I wish to create a simulator. The GUI I want to
make with wxPython both because it has a wealth of components, it's
close to rapid prototyping and it's fun to learn!
However, I do not want to lose speed in the simulation, so I decide to
keep the engine in a C++ based DLL and run the DLL in a different
thread from within my wxPython application.
I assume I can start a thread in a DLL from within python? The DLL
will be C++ / wxWidgets C++ but no graphical elements, it will simply
run forever and I want to see periodic updates in my GUI.
I think I can use some kind of messaging system to get information
from the DLL, start/stop the simulation and have influence on it, how
can I do this ? From wxPython I want to send a message to the DLL that
runs and contains the thread (e.g. a wxThread) and I want to get
messages back, but I am unsure how to bind this in (wx)Python.
The GUI will allow the user to see updates on the data, eventually see
the simulation world in the GUI (I will write a C++ component that
talks to the thread too and displays the world + inhabitants on a
regular base). The simulator will involve some kind of evolution where
players can 'design' a creature and watch it evolve when it cross
breeds and is left about in a virtual world (just for the background
info on the project).
Regards,
- Jorgen
More information about the wxpython-users
mailing list