Using wxpython and ROOT together

I am trying to use wxpython and ROOT (Cern software ) together. Both are even driven and so my problem now is, how can I pass control of the events back and forth. As an example:
In wxpython I read in all the parameters needed to plot data in ROOT, and then call the plotting routine from ROOT. At this point, the event handling goes over to ROOT and I am loosing my control in wxpython. However, the event handling in ROOT is also now broken; after plotting I I can’t do anything anymore and I have to terminate the program. Is there a specific way how I can switch between the two eventhandlers?

In general, mixing GUI event loops just won’t work, at least not reliably.

I don’t have any experience with ROOT, but from this topic it appears that it is designed like similar tools to be able to be used on any generic platform window by passing it the handle of the window that should be it’s parent. For wxPython you would replace the GetHWND function calls with GetHandle, and GetWindowLong can be called via ctypes. Google should be able to turn up examples of that. You may also want to check with any ROOT user groups to see if there are already examples of integrating with wxPython.

This type of embedding usually works fine on Windows, but it can be less solid on the other platforms.

Thanks Robin
I will try this. I am mostly working on Mac and Linux, but it is a start.

Cheers, andi