Hi Experts,
I added a left-button press event handler for the button widget, code like below.
vtkButtonWidget buttonWidget = vtkButtonWidget.New();
buttonWidget.SetInteractor(this.GetInteractor());
buttonWidget.SetRepresentation(buttonRepresentation);
buttonWidget.LeftButtonPressEvt += ButtonWidget_LeftButtonPressEvt;
Unfortunately, this events never got triggered.
I dig into the VTK source code and found the LeftButtonPressEvent was translated to the widget event. See codes below. So, my question is: If I still want to listen to the LeftButtonPressEvent, I need to re-write the widget callback mapper? Are ther any other good solutions or suggestions? Thanks a lot.
vtkButtonWidget::vtkButtonWidget()
{
// Set the initial state
this->WidgetState = vtkButtonWidget::Start;
// Okay, define the events
this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonPressEvent,
vtkWidgetEvent::Select,
this, vtkButtonWidget::SelectAction);
…
}