[vtkusers] vtk mfc double click
maya gen
genmayaius at yahoo.com
Thu May 4 09:07:43 EDT 2006
Hi all,
I've built an application following the "SDI_Instructions" under "Examples\GUI\Win32\vtkMFC", and I want to add an observer for handling double click (I did not use the vtkMFCWindow class). I placed the callback at the CView derived class i.e.
.
.
.
void CvtksdiView::Pipeline()
{
...
}
...
static void handle_double_click(vtkObject* obj, unsigned long, void*, void*)
{
vtkWin32RenderWindowInteractor* iren = vtkWin32RenderWindowInteractor::SafeDownCast(obj);
if(iren && iren->GetRepeatCount())
{
AfxMessageBox("Double Click");
}
}
void CvtksdiView::OnInitialUpdate()
{
CView::OnInitialUpdate();
// get double click events
vtkCallbackCommand* callback = vtkCallbackCommand::New();
callback->SetCallback(handle_double_click);
this->renWin->GetInteractor()->AddObserver(vtkCommand::LeftButtonPressEvent, callback, 1.0);
// TODO: Add your specialized code here and/or call the base class
}
this however did not work. Have I done this the wrong way, or should I place the callback somewhere else.
Thanks in advance
---------------------------------
How low will we go? Check out Yahoo! Messengers low PC-to-Phone call rates.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060504/43608c3a/attachment.htm>
More information about the vtkusers
mailing list