The Colorsetter widget is a color picker that has a text entry area for entering hex color codes. The color is previewed in the button next to the text control, clicking the button will open a color system color selection dialog to choose a color from.


import wx import eclib class MyPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) self.csetter = eclib.ColorSetter(self, wx.ID_ANY, wx.BLACK) sizer = wx.BoxSizer() sizer.Add(self.csetter, 0, wx.ALIGN_CENTER) self.SetSizer(sizer) self.Bind(eclib.EVT_COLORSETTER, self.OnColor) def OnColor(self, evt): color = evt.GetValue() print color