[vtkusers] Question with "AddObserver" from C# Kitware.VTK

David Cole dlrdave at aol.com
Fri Aug 8 06:06:09 EDT 2014


Are you using ActiViz .NET?

The BoxWidget example that comes with ActiViz .NET shows how to sign up 
for VTK events like this:


         boxWidget.EndInteractionEvt += new 
vtkObject.vtkObjectEventHandler(SelectPolygons);


     public static void SelectPolygons(vtkObject sender, 
vtkObjectEventArgs e)
    {
        ...
    }


So... you should be able to do something similar with "KeyPressEvt" on 
the "iren" object.

Also, the EventMonitor example demonstrates how to hook/unhook events, 
and what types of variables you need to hold onto in order for events 
to work well from C#.


HTH,
David C.



More information about the vtkusers mailing list