Hi Natalie,<div><br></div><div>As you found out, there are a couple of ways of handling/catching events in the VTK charts.</div><div>Due to the last changes, I&#39;m not 100% sure they are all compatible with each other anymore. Feel free to report any issue you see.</div>

<div> </div><div>You can look at what is done in vtkControlPointsItem.h/cxx for a fine control of mouse events (e.g. vtkControlPointsItem::MouseDoubleClickEvent). </div><div><br></div><div>To give you the big picture:</div>

<div>vtkContextInteractorStyle is the interactor style for all the charts (we might want to revise it and support custom styles as you mentioned). It listens to the render window interactor and propagates the mouse/keyboard events to the scene, the scene checks on what vtkAbstractContextItem the event is called on, and propagates the event to the item.</div>

<div>ChartXY items (which are not 100% of the vtk charts) have their own event mechanism to handle events at a higher(simpler) level, they still receive the events from the scene and by registering what event you are interested in, you can have custom behavior. You might have to add double click high level support for the chartXY items.</div>

<div><br></div><div>Julien.</div><div><br><div class="gmail_quote">On Wed, Nov 2, 2011 at 2:34 PM, Natalie <span dir="ltr">&lt;<a href="mailto:natis261270@yahoo.com">natis261270@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi Marcus,<br>
<br>
thanks a lot for your reply.<br>
After a long search for the correct class, I found out that I need to<br>
subclass vtkContextInteractorStyle.<br>
<br>
However, in the constructor of vtkContextView the instance is created. The<br>
following lines are from the constructor:<br>
<br>
 vtkContextInteractorStyle* style = vtkContextInteractorStyle::New();<br>
  style-&gt;SetScene(this-&gt;Scene);<br>
  this-&gt;GetInteractor()-&gt;SetInteractorStyle(style);<br>
<br>
Probably, I also need to subclass the vtkContextView and change the<br>
constructor. A little too complicated I thought. I still hope that there is<br>
an easier way.<br>
I am looking forward to more ideas :-)<br>
Natalie<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/vtkChartXY-How-to-catch-mouse-click-events-user-interaction-VTK-5-8-0-tp4943170p4958959.html" target="_blank">http://vtk.1045678.n5.nabble.com/vtkChartXY-How-to-catch-mouse-click-events-user-interaction-VTK-5-8-0-tp4943170p4958959.html</a><br>


</font><div><div></div><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>