3.7.2 Callback Lists

SoTransformBoxDragger - a subclass of SoDragger - is an example of a class using callback lists and its use demonstrated by 15_3_AttachManip.py and and the ``better style'' 15_3iv_AttachManip.py. Callback functions in a callback list are called sequentially from the front to the back of the list.

Usage examples are:

  1. To add a callback function with data to a list:
    myDragger.addStartCallback(dragStartCallback, wrapperMaterial)
  2. To add a callback function without data to a list (in C++ the second argument is sometimes optional, but IVuPy always requires a second None argument):
    myDragger.addStartCallback(dragStartCallback, None)
  3. To remove a callback function from a list:
    myDragger.removeStartCallback(dragStartCallback, wrapperMaterial)
    The algorithm is based on object comparison of the callback function and the callback data object. The first match starting from the back of the list is removed.