SetLeftButtonPressMethod in C++

Vetle Roeim vetler at ifi.uio.no
Tue Feb 29 10:31:22 EST 2000


on 2000-02-29, owner-vtkusers at public.kitware.com wrote:

> I have some problems with the SetLeftButtonPressMethod under VC++ 6.0. I found some documentation but it didn't help. This is what I found:
> 
> "void vtkInteractorStyle::SetLeftButtonPressMethod (void(* f)(void *), void * arg) 
> Callbacks so that the applicaiton can override the default behaviour."
> 
> 
> 
> But I can't get it working. I made the following test-function:
> 
> void Test();
> 
> How can I use the method???? SetLeftButtonPressMethod(Test, NULL) does not work. The compiler says:
> 
> error C2664: 'SetLeftButtonPressMethod' : cannot convert parameter 1 from 'void (void)' to 'void (__cdecl *)(void *)'
>         None of the functions with this name in scope match the target type
> 
> I hope that anyone can help me, 

Try this:

  void Test( void* ) {
      // stuff goes here
  }

  SetLeftButtonPressMethod(Test, NULL);

It works for me (GCC 2.95.2).


vr

--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list