[vtkusers] Callback not firing?

Jeff Baumes jeff.baumes at kitware.com
Mon Oct 19 10:35:09 EDT 2009


I don't see in your code the line:

style->AddObserver(vtkCommand::SelectionChangedEvent,SelectionChangedCallback);

The interactor style invokes the event, so you need to attach the
callback to it.

Jeff

On Fri, Oct 16, 2009 at 8:32 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
> I tried to make a little demo of using a callback by gathering bits from
> some of the tests.
>
> http://www.rpi.edu/~doriad/VTK_List/Callbacks/
>
> The documentation says that the left mouse button of
> vtkInteractorStyleRubberBand2D should trigger a SelectionChangedEvent. In
> this example, I'd expect when I used the rubber band I would see the output
> message "Callback!", but I don't see anything.
>
> I tried attaching the observer to the renderer, render window, and render
> window interactor. None of them seem to trigger the callback.
>
> Can anyone see where I've gone wrong? Is there any kind of tutorial on VTK
> callbacks/events anywhere? Google didn't seem to know of one.
>
> Thanks,
>
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list