vtkCallbackCommand for class member functions

I believe the issue here is that the bar function needs an object to be invoked on. If you change the bar function such that it is a static function it should work. If you need bar to be a non static function you can pass the object it should be invoked on via the clientData pointer. Here is an explanation for that: https://vtk.org/Wiki/VTK/Tutorials/Callbacks

If you are using Qt you can have a look at this: vtkEventQtSlotConnect: Slot not being called - #2 by nicfel and the example https://kitware.github.io/vtk-examples/site/Cxx/Qt/EventQtSlotConnect/