Hi, I’m exploring how the vtk server “event system” works.
I would like to ask a question about the “InvokeEvent” operation (server side).
Into the “protocols.py” there is the “mouseInteraction” method which has the following line:
Into the class “vtk_override_protocols.py” the event is intercepted by the method “addRenderObserver” which prepare the “callback” in the following way (click here to see the code on github):
observerCallback = lambda *args, **kwargs: self.pushRender(realViewId) tag = self.getApplication().AddObserver('UpdateEvent', observerCallback)
So in that way each time the “UpdateEvent” is fired, the “pushRender” is invoked. That’s great!
My question is:
How can I send a value throught the “InvokeEvent” call?
Basically I need to pass a timestamp, so for example:
timeStamp = datetime.now().strftime("%d/%m/%Y %H:%M:%S") self.getApplication().InvokeEvent('UpdateEvent', timeStamp)
And I would like to read the value in the “pushRender” method.
Is that possible? Here I found some hints, but this is for the c++ staff, not for the python ones.
Thanks and regards