[wxPython-users] Not quite understanding buffered DCs

Christopher Barker Chris.Barker at noaa.gov
Wed Dec 27 10:55:24 PST 2006


Robin Dunn wrote:
> It is all for convenience.  That one line in the example replaces about 
> 4 lines it would take to do it without a wx.BufferedPaintDC.  In fact, 
> all of the buffered dc classes are entirely for convenience.  You can do 
> everything they do yourself with just a bitmap, a MemoryDC and a 
> ClientDC or PaintDC.

see:
http://wiki.wxpython.org/index.cgi/DoubleBufferedDrawing

for more detail

> [1] Although it is becoming a better practice to avoid using wx.ClientDC 
> and just call Refresh instead, and do all your painting from the 
> EVT_PAINT handler.  This is because with the newer CoreGraphics API on 
> OS X "out of order repaints" is much more expensive of an operation. 
> It's possible that other platforms may move in this direction as well.

I had a pretty good discussion with Stephan about this a while back, and 
  at the time, I think you pretty much needed to call Update() after the 
Refresh(), to make sure it got to the screen sooner than later. In this 
case, doesn't it do "out of order repaints" anyway?

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list