I don't know how to discard events in the queue with GTK+. The function gdk_flush() will send all events in the queue to the client and wait until all are processed. The events are not deleted; they are processed. The Qt equivalent is QCoreApplication::flush(). <br>
<br>This type of problem is faced all the time by graphics applications. The usual approach is just to set a timer on receiving the first event and ignore all events until the timer fires. It's probably easiest to do this in the handler itself, although Qt does support global event filtering.<br>
<br>See this thread: <a href="http://lists.trolltech.com/qt-interest/2006-02/thread00129-0.html">http://lists.trolltech.com/qt-interest/2006-02/thread00129-0.html</a><br><br>A similar approach is to keep track of the event times, but it looks like Qt does not keep track of times like GTK does.<br>
<br>Michael<br><br><div class="gmail_quote">On Wed, Jun 15, 2011 at 11:33 PM, Dianne Cook <span dir="ltr"><<a href="mailto:visnut@gmail.com">visnut@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Michael,<br>
<br>
I keep forgetting to ask you this... Is there any way to get qt to throw away events when it gets too many? XWindows, and I think gtk, had a function called "flush" which cleared out the event queue periodically. Currently its possible to hang cranvas, if you click a button too many times, as wt struggles to get through responding to all the events.<br>
<br>
cheers,<br>
Di<br>
<br>
---------------------------<br>
Di Cook<br>
<a href="mailto:visnut@gmail.com">visnut@gmail.com</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Qtinterfaces-devel mailing list<br>
<a href="mailto:Qtinterfaces-devel@lists.r-forge.r-project.org">Qtinterfaces-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel</a><br>
</blockquote></div><br>