"""
void wxDC::Clear()
Clears the device context using the current background brush.
...
void wxDC::SetBackground(const wxBrush & brush )
Sets the current background brush for the DC.
"""
You've left out the SetBackground step.
···
On 9/11/11 5:35 PM, Ray Pasco wrote:
Windows 6.1.7601
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit
(Intel)]
Wx Version 2.8.12.0
Wx Pltform ('__WXMSW__', 'wxMSW', 'unicode', 'wx-assertions-on',
'SWIG-1.3.29')
The only way I've been able to clear the background is by using
containerDC.DrawRectangle( 0, 0, container.GetSize() )
dc.Clear() works for all other variations of wx.PaintDC and wx.MemoryDC.
Why not wx.ClientDC ? Is this a know limitation or bug ?
I suppose having separate brushes is a “feature” to avoid having to go to all the trouble to make sure a single, common brush is set properly before doing anything to the bitmap… like having to do this with the pen style. (I realize that Clear() doesn’t use a pen.)