[vtkusers] how to detect a mouse click on boxwidget?

Totte Karlsson totte at dunescientific.com
Mon Aug 10 19:22:01 EDT 2015


Hello,
I'm using a boxwidget to modify the position and orientation of some 
actors.

The box widget become active and initialized as a certain actor is 
clicked on.

Now, if a user clicks on the widget, e.g. leftmouse down, followed by a  
leftmouse up, in say < 100 ms I would want to hide the widget.

However, I can't see how to detect a mouse click on the widget. The only 
event I seem to be able to 'catch' is the InteractionEvent, even though 
I are adding the other events
too, e.g.
     vtkSmartPointer<vtkMyCallback> callback = 
vtkSmartPointer<vtkMyCallback>::New();
     boxWidget->AddObserver(vtkCommand::InteractionEvent, callback);
     boxWidget->AddObserver(vtkCommand::LeftButtonPressEvent, callback);
     boxWidget->AddObserver(vtkCommand::LeftButtonReleaseEvent, callback);

In the widgets associated callback, only the InterationEvent is executed.

Any ideas? Seem puzzling to me.
tk




More information about the vtkusers mailing list