R: [vtk-developers] vtkUserEvents from wxWidgetsCustomEvents

Valeria Gallo g_luigi at fastwebnet.it
Wed Jul 18 06:34:57 EDT 2007

Probably you are using a multi-thread .NET approach, in this case you can
simply solve the problem adding a


wglMakeCurrent(NULL, NULL);


after every occurrence of 




Using this “trick” a thread release its rendering context (the render window
contains a single rendering context as an instance member) when it finishes
rendering so that the next thread can take it.


Let me know



Da: vtk-developers-bounces+g_luigi=fastwebnet.it at vtk.org
[mailto:vtk-developers-bounces+g_luigi=fastwebnet.it at vtk.org] Per conto di
A. Minutolo
Inviato: martedì 17 luglio 2007 17.09
A: vtk-developers at vtk.org
Oggetto: [vtk-developers] vtkUserEvents from wxWidgetsCustomEvents


till now I've successfully integrated wxWindows and VTK in my own
application by using the wxVTKRenderWindowInteractor class.

I have developed a driver for a new interaction device and a
wxWidgetsCustomEvent class that handles the events it generates, now I want
to invoke some vtkUserEvents by using the Callback functions associated to
my wxWidgetsCustomEvent. 
I' ve added the observers and the callback functions of my vtkUserEvents in
vtkInteractorStyle and I've developed a subclass of vtkinteractorStyle with
the necessary functionalities.

If i invoke my vtkEvents from a function associated to a standard wxEvent it
works fine. The problem is that if I invoke the vtkEvents from a function
associated to a custom wxEvent, VTK seems to lose the focus and if I invoke
a grabfocus or a dolly, the application crashes by an error in

After my vtkEvent is invoked the first time, is invoked a
vtkCommand::LeaveEvent like the mouse pointer leaves the vtkwindow, how
could i avoid this invocation and such situation?

Can i invoke vtkEvent from a wxCustomEvent without provoking render or focus
I hope someone can explain me the steps needed in order to create
vtkCustomEvents that can answer to my wxCustomEvents like to standard

Thanks to everybody.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20070718/cb8f0040/attachment.html>

More information about the vtk-developers mailing list