[vtkusers] Release button event doesn't

Clinton Stimpson clinton at elemtech.com
Wed Aug 3 11:34:34 EDT 2011


On Wednesday, August 03, 2011 04:11:26 am al.gry wrote:
> Hi all,
> 
> i'm implementing qt vtk application. The goal is to adjust window level
> using mouse
> 
> ObserverWindowLevel *observeWindowLevel =
> ObserverWindowLevel::New(m_pQVTKIren);
> m_pQVTKIren->AddObserver(vtkCommand::RightButtonPressEvent,
> observeWindowLevel);
> m_pQVTKIren->AddObserver(vtkCommand::RightButtonReleaseEvent,
> observeWindowLevel);
> observeWindowLevel->Delete();
> 
> when i'm trying to catch vtkCommand::RightButtonReleaseEvent in my
> Execute(vtkObject *caller, unsigned long eventId, void *callData) nothing
> happens. It works perfectly for RightButtonPressEvent but for some reason
> RightButtonReleaseEvent is not passed to Execute(...)
> 
> Any ideas?
> 

If I remembert right, this has come up before, and I think the solution was to 
add the observers to the interactor style instead of the interactor.

The behavior comes from an object grabbing focus of events, so the subsequent 
ones are delivered only to that object until focus is released.  That would 
explain why you can't get the right button release event.

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com



More information about the vtkusers mailing list