|Ned Batchelder : Blog | Code | Text | Site|
Aptus 1.55 and wx buffered drawing
» Home : Blog : April 2008
After a pair of releases of Aptus (my Mandelbrot viewer) last weekend, Rob McMullen wrote to me with a patch to eliminate flickering while drawing on Windows. I was thrilled. I've been hacking on side projects with wxPython for a few years now, and the intricacy of paint events, and the vagueness of the double-buffering docs, have conspired to leave me feeling uncertain. When the code works, I sometimes don't understand why.
So I was psyched for Rob's patch. It worked great, the Windows flicker was gone. But on the Mac, nothing was drawing at all! I tried a few simple tweaks, but they didn't help. The previous code had worked without flickering on the Mac, so in the end I used the old code on the Mac and the new code on Windows and Linux. It's not a nice solution, but again, I don't know why it's behaving the way it is, so it's hard for me to track down.
Aptus 1.55 is now posted, and it doesn't flicker on any of the three platforms, but the code still has the ad-hoc platform check in it. If anyone out there knows how this stuff works, and wants to help educate a poor sinner, take a look at the code and drop me a line. I'll be forever grateful.