[wxPython] Blit() flicker problem in linux causing headaches

We are using a wxPython program in a high school classroom to teach students how
to program. The program, which lets students control Karel the Robot via a
simple programming language, flickers in Linux, which is literally giving
students headaches. Our software runs on both Windows and Linux, and the
flickering only occurs on Linux.

Does anybody know why the Blit() method in Linux apparently clears the rectangle
before applying the new bits? The Windows version seems to be more intelligent
about this.

Our basic technique is to use double buffering. We write to a wxMemoryDC(),
then we blit it on to the real DC.

We have sixty students using this program, so any responses will be greatly
appreciated. The flickering problem is spoiling an otherwise beautiful learning
experience.

Thanks,

Steve Howell

Steve Howell wrote:

Does anybody know why the Blit() method in Linux apparently clears the rectangle
before applying the new bits? The Windows version seems to be more intelligent
about this.

Our basic technique is to use double buffering. We write to a wxMemoryDC(),
then we blit it on to the real DC.

Make sure that you are using a wx/ClientDC, rather than a wxPaintDC to blit() to. a wxPaintDC should only be used inside an OnPaint event, which means that it expects that the widow has been damages, and re-paints the whoile thing, clearing it first. A wxClientDC does not do this.

I know this because I had the same problem, which took me a while to fix. If you are using a wxClientDC, make a small sample that demonstrates the problem, post it here, and we'll see what else we can suggest.

-Chris

ยทยทยท

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov