[vtkusers] scriptable callback

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Thu Jul 11 10:13:49 EDT 2002


>>>>> "RH" == Randy Heiland <heiland at ncsa.uiuc.edu> writes:

    RH> What's the trick for invoking a callback on a
    RH> vtkRenderWindowInteractor in a scripting lng (I'm using
    RH> Python)?  Basically, I just want a timer to invoke a method
    RH> that'll update the stuff getting rendered.

Use the AddObserver call.  The TkRenderWindowInteractor does something
like this for the 'CreateTimerEvent'.  So basically call AddObserver
with the right event and pass it a function that will expect the
object and the event as arguments.  You could use the 'TimerEvent'.


class Test:
      def __init__(self):
          self._Iren.AddObserver('CreateTimerEvent', self.CreateTimer)
          ...
      def CreateTimer(self, obj, evt):
          ...

HTH,
cheers,
prabhu



More information about the vtkusers mailing list