[plt-scheme] Flicker problem in win XP, fine on Linux

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Sat Jun 29 07:17:47 EDT 2002

Jens Axel Søgaard wrote:

I have been working on my problem:

> When the screen needs updating, the viewbitmap is copied
> to the canvas:
> (define mycanvas%
>   (class canvas%
>     (inherit get-dc)
>     (define/override (on-subwindow-event receiver event)
>       (dispatch-mouse-event  event))
>     (super-instantiate ())))
> (define canvas   (instantiate mycanvas% ()
>                         (parent horizontal-panel)
>                         (min-width width) (min-height
> height)                         (paint-callback redraw)))
> (define (redraw canvas device-context)
>   (send device-context draw-bitmap viewbitmap 0 0))
> On Windows XP I experience that when redraw is called,
> the canvas is cleared before the viewbitmap is copied to
> the screen. When in point (punkt) mode the canvas is
> redrawn repeatedly and thus causes flicker.
> On Linux the canvas is not cleared, before the copy takes
> place and everything looks beautiful in pointmode [*].
> Can I do something to get rid of the flicker?

Unfortunately, I have been unsuccesful.
I still can't figure out how to stop the clearing before the
copying (Is this WinXP only, or does also occur on Win98?).
Is it some kind of intelligent windov cache, I need to turn off?

I have thought up a kludge. The redrawing takes place on each
mouse event (in free drawing mode (aka point mode). If I
could look ahead in the event queue, to see if there were
more mouse events ahead, I could simply skip the redrawing
(and the unwanted clearing) on these occasions.

Is it possible to look ahead in the event queue?

The program is attached.

Jens Axel Søgaard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tegneprogram2-eng.scm
Type: application/octet-stream
Size: 7120 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20020629/bb01b929/attachment.obj>

Posted on the users mailing list.