Clearing a wx.lib.scrolledpanel.ScrolledPanel

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Clearing a wx.lib.scrolledpanel.ScrolledPanel

jmf-2
Hi,

I don't kown if this is working on a ScrolledPanel, on a
ScrolledWindow one workes likes this:

 From the demo > Core Windows/Controls > ScrolledWindow

    def OnPaint(self, event):
         if BUFFERED:
             # Create a buffered paint DC.  It will create the real
             # wx.PaintDC and then blit the bitmap to it when dc is
             # deleted.  Since we don't need to draw anything else
             # here that's all there is to it.
             dc = wx.BufferedPaintDC(self, self.buffer, wx.BUFFER_VIRTUAL_AREA)
         else:
             dc = wx.PaintDC(self)
             self.PrepareDC(dc)
             # since we're not buffering in this case, we have to
             # paint the whole window, potentially very time consuming.
             self.DoDrawing(dc)

the key point being self.PrepareDC().

Jean-Michel Fauth, Switzerland


Reply | Threaded
Open this post in threaded view
|

Re: Clearing a wx.lib.scrolledpanel.ScrolledPanel

Donn Ingle
> the key point being self.PrepareDC().
Thanks for that, mixed-into some other stuff I did, things are looking
better now. Still get previous images showing through on the edges (near
the scrollbar, but I'll hack on.)

\d