ColorDialogButton#
Added in version 4.10.
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
The GtkColorDialogButton
is a wrapped around a ColorDialog
and allows to open a color chooser dialog to change the color.
It is suitable widget for selecting a color in a preference dialog.
CSS nodes#
colorbutton
╰── button.color
╰── [content]
GtkColorDialogButton
has a single CSS node with name colorbutton which
contains a button node. To differentiate it from a plain GtkButton
,
it gets the .color style class.
Constructors#
- class ColorDialogButton
- classmethod new(dialog: ColorDialog | None = None) → Widget#
Creates a new
GtkColorDialogButton
with the givenGtkColorDialog
.You can pass
NULL
to this function and set aGtkColorDialog
later. The button will be insensitive until that happens.Added in version 4.10.
- Parameters:
dialog – the
GtkColorDialog
to use
Methods#
- class ColorDialogButton
- get_dialog() → ColorDialog | None#
Returns the
GtkColorDialog
ofself
.Added in version 4.10.
- get_rgba() → RGBA#
Returns the color of the button.
This function is what should be used to obtain the color that was chosen by the user. To get informed about changes, listen to “notify::rgba”.
Added in version 4.10.
- set_dialog(dialog: ColorDialog) → None#
Sets a
GtkColorDialog
object to use for creating the color chooser dialog that is presented when the user clicks the button.Added in version 4.10.
- Parameters:
dialog – the new
GtkColorDialog
Properties#
- class ColorDialogButton
- props.dialog: ColorDialog#
The type of the None singleton.
Added in version 4.10.