1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2018 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.BitmapButton` that, when clicked, will
: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
|