X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b881fc787d2823bdd8a415080b82feee90804a17..d19a83a5ac67c97c208e28289bbf4adaee6b4134:/wxPython/wx/lib/colourselect.py?ds=sidebyside diff --git a/wxPython/wx/lib/colourselect.py b/wxPython/wx/lib/colourselect.py index b96dadd29e..8b196d6461 100644 --- a/wxPython/wx/lib/colourselect.py +++ b/wxPython/wx/lib/colourselect.py @@ -86,8 +86,10 @@ class ColourSelect(wx.BitmapButton): self.SetColour(colour) def SetColour(self, colour): - if type(colour) == type( () ): - colour = wxColour(*colour) + if type(colour) == tuple: + colour = wx.Colour(*colour) + if type(colour) == str: + colour = wx.NamedColour(colour) self.colour = colour bmp = self.MakeBitmap() @@ -100,6 +102,7 @@ class ColourSelect(wx.BitmapButton): bmp = wx.EmptyBitmap(width-bdr, height-bdr) dc = wx.MemoryDC() dc.SelectObject(bmp) + dc.SetFont(self.GetFont()) label = self.GetLabel() # Just make a little colored bitmap dc.SetBackground(wx.Brush(self.colour))