[vtkusers] vtkcommand and events

Radu Ilinca radu_away_hu at yahoo.com
Thu Nov 19 04:32:06 EST 2009


To: vtkedge at vtkedge.orgHi all ! 
 
I am trying to catch the LeftButtonPressEvent event using the observer/commannd architecture.  Code is pretty simmilar to the one in the book where it catches the StartEvent (and the code works) but i try the LeftButtonPressEvent.  Code below:
 
class vtkMyCallback : public vtkCommand {
public: static vtkMyCallback *New() { return new vtkMyCallback; }
virtual void Execute( vtkObject *caller, unsigned long, void*) {
vtkRenderer *ren = reinterpret_cast<vtkRenderer*> (caller);
cout << "ana are mere " << endl;
}
}; 
 
 
... in the main ()  i have:
 
vtkMyCallback *mycallback = vtkMyCallback::New(); 
ren1->AddObserver(vtkCommand::LeftButtonPressEvent, mycallback);
 
I am using Visual Studio 2008 and WinXP
 
 
The problem is that, I don't catch the event and actually the code never enters the Execute function. Could someone tell me why ?
 
Best,
Radu. 



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091119/88059464/attachment.htm>


More information about the vtkusers mailing list