A.M. wrote:
I want to explain further that I am more interested in setting the
background color of the control (looks like a combo box) that displays
the date string. Not the calendar control itself that's presented when
you click the dropdown arrow. Maybe that is more doable?
I understood you the first time. I looked into it a little further and I had it a little backwards. The reason it is not displaying the bg color appears to be that the control is not asking for the background to draw itself with in the standard way. It looks like it may be drawing it's own background in the erase background event instead. So you can work around it by handling wx.EVT_ERASE_BACKGROUND yourself.
class DatePickerCtrl(wx.DatePickerCtrl):
def __init__(self, *args, **kw):
wx.DatePickerCtrl.__init__(self, *args, **kw)
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
def OnEraseBackground(self, evt):
dc = evt.GetDC()
dc.SetBackground(wx.Brush(self.GetBackgroundColour()))
dc.Clear()
BTW, the other platforms will likely have troubles setting the bg colour for this control too since they are implemented as a composite control and I don't think it is forwarding the Set*groundColour calls to the components... I'll add that to my todo list.
···
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!