phoenix_title wx.lib.colourselect

Provides a wx.ColourSelect button that, when clicked, will display a colour selection dialog.

Description

This module provides a wx.ColourSelect button that, when clicked, will display a colour selection dialog. The selected colour is displayed on the button itself.

Usage

Sample usage:

import wx
import wx.lib.colourselect as csel

class MyFrame(wx.Frame):

    def __init__(self, parent, title):

        wx.Frame.__init__(self, parent, wx.ID_ANY, title, size=(400, 300))
        self.panel = wx.Panel(self)

        colour_button = csel.ColourSelect(self.panel, -1, "Choose...", wx.WHITE)
        colour_button.Bind(csel.EVT_COLOURSELECT, self.OnChooseBackground)

    def OnChooseBackground(self, event):

        col1 = event.GetValue()
        self.panel.SetBackgroundColour(col1)
        event.Skip()

app = wx.App()
frame = MyFrame(None, 'Select a colour')
frame.Show()
app.MainLoop()

class_summary Classes Summary

ColourSelect

A subclass of wx.lib.buttons.GenBitmapButton that,

ColourSelectEvent

wx.ColourSelectEvent is a special subclassing of wx.CommandEvent

CustomColourData

A simple container for tracking custom colours to be shown in the colour