[vtkusers] Callback not firing?

David Doria daviddoria+vtk at gmail.com
Mon Oct 19 13:51:11 EDT 2009


On Mon, Oct 19, 2009 at 10:35 AM, Jeff Baumes <jeff.baumes at kitware.com> wrote:
> 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
>

Thanks Jeff - that did it. This is exactly the type of thing I am
trying to sort out and make examples of for the wiki (although I think
the better solution is still for better documentation in the classes
themselves so the doxygen pages contain this type of information).

Another thing: I tried to override this function:

void vtkInteractorStyleRubberBand2D::OnLeftButtonUp()
{
  vtkstd::cout << "LeftButtonUp!" << vtkstd::endl;
}

but now when I release the button the rubberband outline is not
erased. I'm assuming I have to "forward" the event to whichever
function was going to handle this before I overrode the function - how
would I find out which function that is / how to do that?

Thanks,

David



More information about the vtkusers mailing list