GradientFillLinear

Are you printing the clipping rect to make sure it isn't empty?

What is on the window? Remember that WM_ERASEBACKGND is always sent
immediately before a WM_PAINT. If the contents of your window
completely cover the inside area, then nothing of the gradient will show
through.

···

On Thu, 10 Aug 2006 22:17:08 +0100, "Davy Mitchell" <daftspaniel@gmail.com> wrote:

I am having trouble with GradientFillLinear (WX2.7).

    def OnEraseBackground(self, evt):
        dc = evt.GetDC()
        if not dc:
            dc = wxClientDC(self)
            rect = self.GetUpdateRegion().GetBox()
            dc.SetClippingRect(rect)
        dc.GradientFillLinear(self.GetRect(),wxColour(23, 23,
23),wxColour(255, 255, 255))
        print "pop"
        print self.GetRect()

Nothing appears to be drawn though the function is called and the rect
area seems valid. Sorry if I am missing something obvious!!

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Thanks Tim and Robin - problem now solved. The background I was trying
to paint turns out to have a panel on top of it. I bound the event to
the panel and it works perfectly. The slideshow looks great now with a
gradient background :slight_smile:

I'm updating an old Boa generated App from 2 years ago and still
getting my head round its generated GUI code.... :slight_smile:

Cheers,
Davy Mitchell

http://www.latedecember.com/sites/personal/davy/

···

On 8/11/06, Tim Roberts <timr@probo.com> wrote:

What is on the window? Remember that WM_ERASEBACKGND is always sent
immediately before a WM_PAINT. If the contents of your window
completely cover the inside area, then nothing of the gradient will show
through.