Gtk.ColorDialogButton¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (17), Gtk.Buildable (1)
- Structs:
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Emitted when the color dialog button is activated. |
Fields¶
- Inherited:
Class Details¶
- class Gtk.ColorDialogButton(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Opens a color chooser dialog to select a color.
<picture> <source srcset=”color-button-dark.png” media=”(prefers-color-scheme: dark)”> <img alt=”An example
Gtk.ColorDialogButton" src=”color-button.png”> </picture>It is suitable widget for selecting a color in a preference dialog.
- CSS nodes
`` colorbutton ╰── button.color
╰── [content]
GtkColorDialogButtonhas a single CSS node with name colorbutton which contains a button node. To differentiate it from a plainGtkButton, it gets the .color style class.New in version 4.10.
- classmethod new(dialog)[source]¶
- Parameters:
dialog (
Gtk.ColorDialogorNone) – theGtkColorDialogto use- Returns:
the new
GtkColorDialogButton- Return type:
Creates a new
GtkColorDialogButtonwith the givenGtkColorDialog.You can pass
NULLto this function and set aGtkColorDialoglater. The button will be insensitive until that happens.New in version 4.10.
- get_dialog()[source]¶
- Returns:
the
GtkColorDialog- Return type:
Returns the
GtkColorDialogof self.New in version 4.10.
- get_rgba()[source]¶
- Returns:
the color
- Return type:
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”.
New in version 4.10.
- set_dialog(dialog)[source]¶
- Parameters:
dialog (
Gtk.ColorDialog) – the newGtkColorDialog
Sets a
GtkColorDialogobject to use for creating the color chooser dialog that is presented when the user clicks the button.New in version 4.10.
Signal Details¶
- Gtk.ColorDialogButton.signals.activate(color_dialog_button)¶
- Signal Name:
activate- Flags:
- Parameters:
color_dialog_button (
Gtk.ColorDialogButton) – The object which received the signal
Emitted when the color dialog button is activated.
The
::activatesignal onGtkColorDialogButtonis an action signal and emitting it causes the button to pop up its dialog.New in version 4.14.
Property Details¶
- Gtk.ColorDialogButton.props.dialog¶
- Name:
dialog- Type:
- Default Value:
- Flags:
The
GtkColorDialogthat contains parameters for the color chooser dialog.New in version 4.10.
- Gtk.ColorDialogButton.props.rgba¶
- Name:
rgba- Type:
- Default Value:
- Flags:
The selected color.
This property can be set to give the button its initial color, and it will be updated to reflect the users choice in the color chooser dialog.
Listen to
notify::rgbato get informed about changes to the buttons color.New in version 4.10.