> Is that a valid use case?<br><br>Not sure :)  I wouldn't personally design an application around this use case (I prefer Qt's event loop), but I can see why it's useful to folks who want to design a single-threaded game-engine style loop:<br>

<br>while (1)<br>{<br><br>// handle pending key & mouse events<br><br>// render if dirty<br><br>// do stuff<br><br>}<br><br> The problem is that the vtkRenderWindowInteractor does not provide any API for dispatching pending events and then returning control.  It would be great if there was API like:<br>

<br>void DispatchPendingEvents();<br>void WaitForEvents(timeout);<br><br>But, since that API is missing, you can roughly accomplish the same thing by calling Start() after posting a timer event to call TerminateApp after some number of milliseconds.  I think that TerminateApp is probably a poor name, since it certainly does not terminate the app, it just breaks the event loop and returns so that you can clean up your app safely.  The inconsistent behavior is that, on OSX, TerminateApp doesn't just break the event loop, it also calls close on your render window for no good apparent reason.<br>

<br>Anyway, I appreciate you taking the time to look over the patch details!  If we decide to proceed with the patch, you said some more changes might be needed, any hints what those might be?<br><br>Pat<br><br><br><br><div class="gmail_quote">

On Fri, Aug 3, 2012 at 5:38 PM, Sean McBride <span dir="ltr"><<a href="mailto:sean@rogue-research.com" target="_blank">sean@rogue-research.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Fri, 3 Aug 2012 11:36:00 -0400, Pat Marion said:<br>
<br>
</div><div class="im">>Attached is a test program that makes repeated calls to interactor Start()<br>
>and TerminateApp().<br>
<br>
</div>Is that a valid use case?<br>
<br>
>From its name, I thought TerminateApp() was supposed to terminate the process?  If so, it doesn't make sense to do anything after. :)<br>
<br>
The doxygen does not help me, saying only "This function is called on 'q','e' keypress if exitmethod is not specified and should be overridden by platform dependent subclasses to provide a termination procedure if one is required."<br>


<br>
Are you saying that TerminateApp() is it meant to be the complement of Start()?  (That seems to be the case with vtkCarbonRenderWindowInteractor)<br>
<br>
If so, I think your patch is a start, but more changes are needed....<br>
<div class="HOEnZb"><div class="h5"><br>
Cheers,<br>
<br>
--<br>
____________________________________________________________<br>
Sean McBride, B. Eng                 <a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a><br>
Rogue Research                        <a href="http://www.rogue-research.com" target="_blank">www.rogue-research.com</a><br>
Mac Software Developer              Montréal, Québec, Canada<br>
<br>
<br>
</div></div></blockquote></div><br>