[wxPython-users] Not quite understanding buffered DCs

Robin Dunn robin at alldunn.com
Wed Dec 27 12:22:14 PST 2006


Christopher Barker wrote:
> Robin Dunn wrote:

>> [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?

No, as I understand it using Refresh/Update just reprioritizes the 
normal order so the paint event happens now, but it still goes through 
the normal procedure to actually do the drawing to the screen.  On the 
other hand, using a wxClientDC causes the drawing to happen at an 
unexpected time in the normal procedure and so some things need to be 
suspended in order for that to happen.  (Or something like that, I'm 
pulling this from some old rusty memory banks...)  With wxDC using the 
old QuickDraw API it was possible to do that, but with CoreGraphics it 
is not.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list