Custom Controls → PyColourChooser

overview = """\

The PyColourChooser component creates a colour chooser window
that is similar to the Microsoft Windows colour chooser dialog.
This dialog component is drawn in a panel, and thus can be
embedded inside any widget (although it cannot be resized).
This colour chooser may also be substituted for the colour
chooser on any platform that might have an ugly one :)

"""
   
   
import wx
import wx.lib.colourchooser as colourchooser
  
  
class Frame(wx.Frame):

def __init__(
  self, parent=None, id=wx.ID_ANY, title='wx.lib.colourchooser.PyColourChooser', pos=wx.DefaultPosition,
  size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE
  ):
  
  wx.Frame.__init__(self, parent, id, title, pos, size, style)
  self.SetIcon(wx.Icon('wxWidgets.ico', wx.BITMAP_TYPE_ICO))
  
  # panel = wx.Panel(self, wx.ID_ANY)
  colourChoose = colourchooser.PyColourChooser(self, wx.ID_ANY)
  # Attention!
  # Glanced at wxPython document, we found that PyColourChooser is the subclass
  # of Panel, so PyColourChooser can be directly built as Frame's child.
  # Of course, PyColourChooser is the panel, so it can be built as another panel's child.
  
  
  
def TestFrame():
app = wx.PySimpleApp()
frame = Frame(size=(480, 400))
frame.Centre()
frame.Show()
app.MainLoop()


if __name__ == '__main__':
TestFrame()