<div dir="ltr">I suspect timer events are fired but something else is consuming them. Probably in the interactor style. Try adding your timer events with a higher priority like 10.0 (third argument).</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen <span dir="ltr"><<a href="mailto:petersenkolja@gmail.com" target="_blank">petersenkolja@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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><span style="font-size:12.8px"><wbr>)</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><span style="font-size:12.8px">vtkInteractorStyleTrackbal<wbr>lCam</span><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><span style="font-size:12.8px">vtkComman<wbr>d.TimerEvent,</span><span style="font-size:12.8px">observer)</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.AddObserver(vtk.</span><span style="font-size:12.8px">vtkComman<wbr>d.MouseMoveEvent,</span><span style="font-size:12.8px">observer)</span><br style="font-size:12.8px"><span style="font-size:12.8px">iren.AddObserver(vtk.</span><span style="font-size:12.8px">vtkComman<wbr>d.InteractionEvent,</span><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="m_5020402281578617109DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br> <table style="border-top:1px solid #d3d4de">
        <tbody><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" style="color:#4453ea" target="_blank">www.avast.com</a>            </td>
        </tr>
</tbody></table>
<a href="#m_5020402281578617109_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Ken Martin PhD<div>Distinguished Engineer<br><span style="font-size:12.8px">Kitware Inc.</span><br></div><div>28 Corporate Drive<br>Clifton Park NY 12065<br><div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div></div></div>
</div>