[vtkusers] problem about vtkvtkCallbackCommand

王斌 wb at huahai.com.cn
Mon Dec 16 19:34:01 EST 2002


hello vtkusers
	i write a program to test the vtkCallbackCommand class.but the CallBackProc function did not happen.
i don't know why.any advice are what i want, thanks in advance.
    void main()
{
	vtkCallbackCommand *CallBackCm=vtkCallbackCommand::New();
	vtkRenderer *aRenderer=vtkRenderer::New();
	vtkRenderWindow *renWin=vtkRenderWindow::New();
	renWin->AddRenderer(aRenderer);
	vtkWin32RenderWindowInteractor *iren=vtkWin32RenderWindowInteractor::New ();
	iren->SetRenderWindow(renWin);

	CallBackCm->SetCallback (&CallBackProc);
	iren->AddObserver (vtkCommand::LeftButtonPressEvent,CallBackCm);
	renWin->Render();
	iren->Start();
}

void CallBackProc(vtkObject *object,unsigned long msg,void* ,void* )
{

	MessageBox(NULL,"LeftButtonPressEvent happen","congraduation",MB_OK);
	
}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 9.gif
Type: image/gif
Size: 1572 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20021217/1eee35a0/attachment.gif>


More information about the vtkusers mailing list