# vtkCallbackCommand for class member functions

**URL:** https://discourse.vtk.org/t/vtkcallbackcommand-for-class-member-functions/6591
**Category:** Support
**Created:** [September 9, 2021, 11:30am UTC](https://discourse.vtk.org/t/vtkcallbackcommand-for-class-member-functions/6591 "2021-09-09T11:30:32Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![nicfel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nicfel/32/3639_2.png) [@nicfel](https://discourse.vtk.org/u/nicfel)
#### Post date: [September 9, 2021, 12:04pm UTC](https://discourse.vtk.org/t/vtkcallbackcommand-for-class-member-functions/6591/2 "2021-09-09T12:04:20Z")

</div>

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](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](https://discourse.vtk.org/t/vtkeventqtslotconnect-slot-not-being-called/6566/2) and the example [https://kitware.github.io/vtk-examples/site/Cxx/Qt/EventQtSlotConnect/](https://kitware.github.io/vtk-examples/site/Cxx/Qt/EventQtSlotConnect/)

---

_[View the full topic](https://discourse.vtk.org/t/vtkcallbackcommand-for-class-member-functions/6591)._
