| Top |
| CtkWidget * | ctk_color_button_new () |
| CtkWidget * | ctk_color_button_new_with_color () |
| CtkWidget * | ctk_color_button_new_with_rgba () |
| void | ctk_color_button_set_color () |
| void | ctk_color_button_get_color () |
| void | ctk_color_button_set_alpha () |
| guint16 | ctk_color_button_get_alpha () |
| void | ctk_color_button_set_rgba () |
| void | ctk_color_button_get_rgba () |
| void | ctk_color_button_set_use_alpha () |
| gboolean | ctk_color_button_get_use_alpha () |
| void | ctk_color_button_set_title () |
| const gchar * | ctk_color_button_get_title () |
GObject
╰── GInitiallyUnowned
╰── CtkWidget
╰── CtkContainer
╰── CtkBin
╰── CtkButton
╰── CtkColorButton
CtkColorButton implements AtkImplementorIface, CtkBuildable, CtkActionable, CtkActivatable and CtkColorChooser.
The CtkColorButton is a button which displays the currently selected color and allows to open a color selection dialog to change the color. It is suitable widget for selecting a color in a preference dialog.
CtkColorButton has a single CSS node with name button. To differentiate it from a plain CtkButton, it gets the .color style class.
CtkWidget *
ctk_color_button_new (void);
Creates a new color button.
This returns a widget in the form of a small button containing a swatch representing the current selected color. When the button is clicked, a color-selection dialog will open, allowing the user to select a color. The swatch will be updated to reflect the new color when the user finishes.
Since: 2.4
CtkWidget *
ctk_color_button_new_with_color (const CdkColor *color);
Creates a new color button.
Since: 2.4
CtkWidget *
ctk_color_button_new_with_rgba (const CdkRGBA *rgba);
Creates a new color button.
Since: 3.0
void ctk_color_button_set_color (CtkColorButton *button,const CdkColor *color);
Sets the current color to be color
.
Since: 2.4
void ctk_color_button_get_color (CtkColorButton *button,CdkColor *color);
Sets color
to be the current color in the CtkColorButton widget.
Since: 2.4
void ctk_color_button_set_alpha (CtkColorButton *button,guint16 alpha);
Sets the current opacity to be alpha
.
Since: 2.4
guint16
ctk_color_button_get_alpha (CtkColorButton *button);
Returns the current alpha value.
Since: 2.4
void ctk_color_button_set_rgba (CtkColorButton *button,const CdkRGBA *rgba);
Sets the current color to be rgba
.
[skip]
Since: 3.0
void ctk_color_button_get_rgba (CtkColorButton *button,CdkRGBA *rgba);
Sets rgba
to be the current color in the CtkColorButton widget.
[skip]
Since: 3.0
void ctk_color_button_set_use_alpha (CtkColorButton *button,gboolean use_alpha);
Sets whether or not the color button should use the alpha channel.
Since: 2.4
gboolean
ctk_color_button_get_use_alpha (CtkColorButton *button);
Does the color selection dialog use the alpha channel ?
Since: 2.4
void ctk_color_button_set_title (CtkColorButton *button,const gchar *title);
Sets the title for the color selection dialog.
Since: 2.4
const gchar *
ctk_color_button_get_title (CtkColorButton *button);
Gets the title of the color selection dialog.
Since: 2.4
“alpha” property “alpha” guint
The selected opacity value (0 fully transparent, 65535 fully opaque).
Owner: CtkColorButton
Flags: Read / Write
Allowed values: <= 65535
Default value: 65535
Since: 2.4
“color” property“color” CdkColor *
The selected color.
Owner: CtkColorButton
Flags: Read / Write
Since: 2.4
“rgba” property“rgba” CdkRGBA *
The RGBA color.
Owner: CtkColorButton
Flags: Read / Write
Since: 3.0
“show-editor” property “show-editor” gboolean
Set this property to TRUE to skip the palette
in the dialog and go directly to the color editor.
This property should be used in cases where the palette in the editor would be redundant, such as when the color button is already part of a palette.
Owner: CtkColorButton
Flags: Read / Write
Default value: FALSE
Since: 3.20
“title” property “title” char *
The title of the color selection dialog
Owner: CtkColorButton
Flags: Read / Write
Default value: "Pick a Color"
Since: 2.4
“use-alpha” property “use-alpha” gboolean
If this property is set to TRUE, the color swatch on the button is
rendered against a checkerboard background to show its opacity and
the opacity slider is displayed in the color selection dialog.
Owner: CtkColorButton
Flags: Read / Write
Default value: FALSE
Since: 2.4
“color-set” signalvoid user_function (CtkColorButton *widget, gpointer user_data)
The ::color-set signal is emitted when the user selects a color.
When handling this signal, use ctk_color_button_get_rgba() to
find out which color was just selected.
Note that this signal is only emitted when the user changes the color. If you need to react to programmatic color changes as well, use the notify::color signal.
widget |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since: 2.4