]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/colourselect.py
Added a typemap that converts the references returned for some GDI
[wxWidgets.git] / wxPython / wx / lib / colourselect.py
index b96dadd29e3567de889f3e666e2681f39ffccaff..8b196d6461c4827dfcefdd699368617b2a33053e 100644 (file)
@@ -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))