<div dir="ltr"><span style="font-size:12.8px">Heya,</span><br style="font-size:12.8px"><span style="font-size:12.8px">I paste some code below, which displays an empty vtkRenderWindow with an interactor. The interactor fires a TimerEvent every 100ms as printed by the Observer.</span><br style="font-size:12.8px"><span style="font-size:12.8px">The problem: as long as I press a mouse button in the vtkRenderWindow, the TimerEvents stop to be reported, although I need to process data periodically in my application as a reaction to those TimerEvents.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Why are no TimerEvents fired while a button is pressed, and how can I change this behaviour?</span><br style="font-size:12.8px"><span style="font-size:12.8px">Thank you</span><br style="font-size:12.8px"><span style="font-size:12.8px">Kolja</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">import vtk</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">class Observer(object):</span><br style="font-size:12.8px"><span style="font-size:12.8px"> def __init__(self):</span><br style="font-size:12.8px"><span style="font-size:12.8px"> self.cnt=0</span><br style="font-size:12.8px"><span style="font-size:12.8px"> def __call__(self,caller,evt):</span><br style="font-size:12.8px"><span style="font-size:12.8px"> self.cnt+=1</span><br style="font-size:12.8px"><span style="font-size:12.8px"> print "count %d %s" % (self.cnt,evt)</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">ren1 = vtk.vtkRenderer()</span><br style="font-size:12.8px"><span style="font-size:12.8px">ren1.SetBackground(0.1, 0.2, 0.4)</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">renWin = vtk.vtkRenderWindow()</span><br style="font-size:12.8px"><span style="font-size:12.8px">renWin.AddRenderer(ren1)</span><br style="font-size:12.8px"><span style="font-size:12.8px">renWin.SetSize(300, 300)</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">iren = vtk.vtkRenderWindowInteractor(</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">)</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.SetRenderWindow(renWin)</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">style = vtk.</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">vtkInteractorStyleTrackballCam</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">era()</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.SetInteractorStyle(style)</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">iren.Initialize()</span><br style="font-size:12.8px"><span style="font-size:12.8px">observer=Observer()</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.AddObserver(vtk.</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">vtkCommand.TimerEvent,</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">observer)</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.AddObserver(vtk.</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">vtkCommand.MouseMoveEvent,</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">observer)</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.AddObserver(vtk.</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">vtkCommand.InteractionEvent,</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">observer)</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.CreateRepeatingTimer(100)</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.Start()</span><br></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br> <table style="border-top:1px solid #d3d4de">
<tr>
<td style="width:55px;padding-top:18px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
<td style="width:470px;padding-top:17px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virenfrei. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank" style="color:#4453ea">www.avast.com</a> </td>
</tr>
</table>
<a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>