How can I use a vtk interactor with an external event loop?

I have a program that has a GUI written in gtk+2 and uses vtk for 3D graphics. Currently we handle all mouse and keyboard events in gtk+2, and don’t use a vtkRenderWindowInteractor at all. We call vtk methods in response to mouse events in the gtk event loop. This is a bit cumbersome, and think life would be easier if we could use a vtkRenderWindowInteractor and vtkInteractorStyle instead. However, it would be very difficult to give up the gtk event loop. I’d rather hook into the vtk interactor from an idle callback or event handler in the gtk event loop. It looks like this is possible – the documentation for vtkRenderWindowInteractor::Start() says that it’s possible to use ones own event loop. How do I do that? I can’t find an example or instructions…

Thanks.

I think something similar is done in the QVTKWidget where the vtkInteractor’s render loop is not started and the interaction is forwarded from Qt to VTK.

https://vtk.org/doc/nightly/html/classQVTKWidget.html#details

Edo