fsleyes_widgets.colourbutton¶
This module provides the ColourButton class, a button which
allows the user to select a RGBA colour.
Bases:
wx._core.ButtonA
wx.Buttonwhich allows the user to select a colour.The currently selected colour is displayed as a bitmap on the button. When the user presses the button, a
wx.ColourDialogis displayed, allowing the user to change the colour. When the user does so, aEVT_COLOUR_BUTTON_EVENTis generated.This class provides an alternative to the
wx.ColourPickerCtrl, which is a bit inflexible w.r.t. sizing/automatic resizing.Create a
ColourButton.Parameters: - parent – A
wxparent window. - size – A tuple containing the
(width, height)of the colour bitmap in pixels. Defaults to(32, 32). - colour – Initial colour. Defaults to black.
Create a
ColourButton.Parameters: - parent – A
wxparent window. - size – A tuple containing the
(width, height)of the colour bitmap in pixels. Defaults to(32, 32). - colour – Initial colour. Defaults to black.
- parent – A
Return the current colour, as a tuple of
(r, g, b, a)values, each in the range[0 - 255].
Sets the current colour to the specified
colour.
Called when this
ColourButtonis pressed.Displays a
wx.ColourDialogallowing the user to select a new colour.
Called when the colour is changed. Updates the bitmap shown on the button.
- parent – A
Identifier for the
ColourButtonEvent.
alias of
wx.lib.newevent.NewEvent.<locals>._Event