Bug in TextCtrl.SetForegroundColour on Mac

Hello all,

Can anyone confirm a bug in TextCtrl.SetForegroundColour on the Mac for
me? In the sample application below, use the colour selector button to
set the foreground colour of the text control (it also updates the
contents to show the RGB values).

On Windows (XP SP2), every colour I've tried has updated the text
control as expected. However, on the Mac (Leopard, in case it makes any
difference), once the colour has changed away from black (0, 0, 0, 255),
it is impossible to change it back to black. The colour remains at its
previous setting.

This is using version 2.8.7.1 (unicode) on both platforms.

I've found messages indicating that SetBackgroundColour doesn't work for
single-line text controls on the Mac (eg.
http://thread.gmane.org/gmane.comp.python.wxpython/34562/), but nothing
for SetForegroundColour.

I can work around it for now by using something like (0, 0, 1, 255)
instead of black, but if others can confirm the same behaviour, should I
raise a bug?

Thanks a lot,

Simon King

···

---------------------------------------------------------------
import wx
import wx.lib.colourselect as csel
import wx.lib.inspection

class TestFrame(wx.Frame):
    def __init__(self, *args, **kwargs):
        wx.Frame.__init__(self, *args, **kwargs)

        self.text = wx.TextCtrl(self)
        self.button = csel.ColourSelect(self)

        self.text.SetValue(str(self.button.GetValue()))
        
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.text)
        sizer.Add(self.button)

        self.SetSizer(sizer)
        self.Fit()

        self.Bind(csel.EVT_COLOURSELECT, self.OnColourSelected)

    def OnColourSelected(self, event):
        colour = event.GetValue()
        self.text.SetValue(str(colour))
        self.text.SetForegroundColour(colour)

if __name__ == '__main__':
    print wx.version()
    app = wx.PySimpleApp(False)
    frame = TestFrame(None)
    frame.Show()
    #wx.lib.inspection.InspectionTool().Show()
    app.MainLoop()