Can't clear Clipping region in PaintDC

I've noticed this before also (I have no idea why it's this way). What
I did was use wx.Window.GetUpdateRegion() instead:

rgn = self.GetUpdateRegion()
box = rgn.GetBox()

And if you want to update the whole window on a resize then call
self.Refresh() in an EVT_SIZE handler.

-Paul

ScaleWindow2.py (7.15 KB)

···

-----Original Message-----
From: Christopher Barker [mailto:Chris.Barker@noaa.gov]
Sent: Friday, October 20, 2006 12:18 PM
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] Can't clear Clipping region in PaintDC

Hi all,

I really thought that I "got" wx.DCs, but this one has me stumped. I'm
hoping I'm missing something obvious.

it appears that the wx.PaintDC is setting a clipping region, and only
drawing to the new part of the Windows on re-size. However, when I call:

dc.GetClippingBox()

IU get (0,0,0,0)

and calling:

dc.DestroyClippingRegion()

seems to have no effect. What am I missing?

Python 2.4.3, wxPython 2.6.3.3, wxGTK unicode on Fedora core 4.

sample enclosed -- try resizing the frame, and see what happens -- I
want a single rectangle with a gradient of color.

Thanks,

-Chris

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov