[plt-scheme] double on-paint
At Thu, 7 Dec 2006 16:31:00 -0600, "pedro pinto" wrote:
> On Windows XP, with DrScheme v360, the following code:
>
> (define f (new frame% (label "Hello")))
>
> (define c (new canvas% (parent f)
> (paint-callback (lambda _ (printf "painting~n")))))
>
> (send f show #t)
>
> Will print "painting" twice, with a noticeable delay between the two
> messages, every time the frame is resized. That's not right is it?
My guess is that both resize and refresh events from from the OS, and
MrEd at some point triggers a refresh to handle the resize event. I may
be able to improve that.
Is the delay you see just a delay in DrScheme's output? I see a
significant delay, too, but when I include the result of
`(current-milliseconds)' in the printed message, then the printed
numbers usually differ by only 20 or 30 milliseconds.
Matthew