.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. module:: wx.lib.colourselect

.. currentmodule:: wx.lib.colourselect

.. highlight:: python



.. _wx.lib.colourselect:

==========================================================================================================================================
|phoenix_title|  **wx.lib.colourselect**
==========================================================================================================================================

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


Description
===========

This module provides a :class:`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
===============================

================================================================================ ================================================================================
:ref:`~wx.lib.colourselect.ColourSelect`                                         A subclass of :class:`wx.lib.buttons.GenBitmapButton` that,
:ref:`~wx.lib.colourselect.ColourSelectEvent`                                    :class:`wx.ColourSelectEvent` is a special subclassing of :class:`wx.CommandEvent`
:ref:`~wx.lib.colourselect.CustomColourData`                                     A simple container for tracking custom colours to be shown in the colour
================================================================================ ================================================================================


|


.. toctree::
   :maxdepth: 1
   :hidden:

   wx.lib.colourselect.ColourSelect
   wx.lib.colourselect.ColourSelectEvent
   wx.lib.colourselect.CustomColourData



