<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-cite-prefix">On 03/21/2014 02:16 PM, John Clements
wrote:<br>
</div>
<blockquote
cite="mid:69077111-4EE9-4F31-B798-A0C68B4CD248@brinckerhoff.org"
type="cite">
<pre wrap="">2) upstream, inherit from canvas% and add code to limit the rate of calls to draw. I haven’t looked at the code yet, but this might be my best bet.</pre>
</blockquote>
I tried overriding "refresh", and there's a tempting mention in the
docs that "(Multiple refresh
requests before <span class="RktSym"><a
href="http://docs.racket-lang.org/gui/canvas___.html#%28meth._%28%28%28lib._mred%2Fmain..rkt%29._canvas%7E3c%7E25%7E3e%29._on-paint%29%29"
class="RktValLink" data-pltdoc="x">on-paint</a></span> can be
called are
coaleced into a single <span class="RktSym"><a
href="http://docs.racket-lang.org/gui/canvas___.html#%28meth._%28%28%28lib._mred%2Fmain..rkt%29._canvas%7E3c%7E25%7E3e%29._on-paint%29%29"
class="RktValLink" data-pltdoc="x">on-paint</a></span> call.)"
This does work if you have code that is explicitly calling
"refresh".<br>
<a class="moz-txt-link-freetext" href="http://docs.racket-lang.org/gui/canvas___.html">http://docs.racket-lang.org/gui/canvas___.html</a><br>
<br>
Unfortunately it looks like "refresh" doesn't get called by
lower-level stuff like scrollbars. Can anyone confirm this?<br>
<blockquote
cite="mid:69077111-4EE9-4F31-B798-A0C68B4CD248@brinckerhoff.org"
type="cite">
<pre wrap="">3) one other thing occurs to me, though; it looks to me like calls to ‘draw’ are stacking up in an eventspace queue, and that seems like a mistake; if there’s a draw in progress, and calls to draw in the queue, it seems like another ‘draw’ should at a minimum squash the ones in the queue. Perhaps that’s painful to implement, or there’s a good reason for allowing all of the queued calls to complete?
</pre>
</blockquote>
I'm also seeing this (on Linux), or at least, it seems like many
paints are happening but the back buffer is not being flushed to the
screen. When I run the attached code, and then scroll a lot, then I
see more dots printed to the console than frames being shown.<br>
<br>
When I run it on Windows (from console) then things look much
better, and it looks like I'm seeing every paint. <br>
<br>
When I run it inside DrRacket on Windows I see no updates while
scrolling until letting go of the scrollbar (different issue?)<br>
<br>
What do you see on Mac?<br>
<br>
Thanks,<br>
Dave<br>
</body>
</html>