[vtkusers] Event Handling with SelectionChangedEvent

Aytekin Vargun varguna at gmail.com
Mon Feb 9 11:11:12 EST 2009


Hi,
I am currently having problems with my event handler and would appreciate if
anybody suggests me  a solution.

The ProcessVertexSelection (user defined) method is activated when some
selections are made (based on SelectionChangeEvent). Everything is good upto
this point. Here is the code for this:

edgePicked->SetCallback(network->ProcessVertexSelection);
edgePicked->SetClientData((void *)static_cast<vtkSelectionLink*>(edgeLink));
selections->AddObserver(vtkCommand::SelectionChangedEvent, edgePicked);

This part works and I can get the selections. Now I want to add another
functionality: The user may want to delete the current selections by using
key 'd' or "delete" whichever is simple to implement. I know that GetKeySym
can be used to get key symbol. However, if I add the following code to
activate another method to do deletions, the event handler ignores it. It
never activates the method which is named as EVTDelete (in my code) where I
plan to check which key is used.

delPicked->SetCallback(network->EVTDelete);
delPicked->SetClientData((void *)static_cast<vtkSelectionLink*>(edgeLink));
selections->AddObserver(vtkCommand::KeyPressEvent, delPicked);

Why doesn't my event handler listen do the keypresses other than the default
ones?
Thanks a lot.
Aytekin

-- 
My web page: http://www.cs.rpi.edu/~vargua
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090209/b02b9b34/attachment.htm>


More information about the vtkusers mailing list