Package wx :: Class BufferedPaintDC
[frames | no frames]

Type BufferedPaintDC

object --+                    
         |                    
    Object --+                
             |                
            DC --+            
                 |            
          WindowDC --+        
                     |        
              MemoryDC --+    
                         |    
                BufferedDC --+
                             |
                            BufferedPaintDC


This is a subclass of wx.BufferedDC which can be used inside of an EVT_PAINT event handler. Just create an object of this class instead of wx.PaintDC and that's all you have to do to (mostly) avoid flicker. The only thing to watch out for is that if you are using this class together with wx.ScrolledWindow, you probably do not want to call wx.Window.PrepareDC on it as it already does this internally for the real underlying wx.PaintDC.

If your window is already fully buffered in a wx.Bitmap then your EVT_PAINT handler can be as simple as just creating a wx.BufferedPaintDC as it will Blit the buffer to the window automatically when it is destroyed. For example:

def OnPaint(self, event):
    dc = wx.BufferedPaintDC(self, self.buffer)

Method Summary
BufferedPaintDC __init__(self, window, buffer, style)
Create a buffered paint DC.

Property Summary
  thisown: The membership flag

Method Details

__init__(self, window, buffer=NullBitmap, style=BUFFER_CLIENT_AREA)
(Constructor)

Create a buffered paint DC. As with wx.BufferedDC, you may either provide the bitmap to be used for buffering or let this object create one internally (in the latter case, the size of the client part of the window is automatically used).

Parameters:
window
           (type=Window)

buffer
           (type=Bitmap)

style
           (type=int)

Returns:
BufferedPaintDC
Overrides:
wx.BufferedDC.__init__

Property Details

thisown

The membership flag


Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:53:23 2009 http://epydoc.sf.net