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 GtkColorDialogButton" src="color-button.png"> </picture> 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.
<group>Buttons and Toggles</group>
function "+"
(Widget : access Gtk_Color_Dialog_Button_Record'Class)
return Gtk.Accessible.Gtk_Accessible
function "+"
(Widget : access Gtk_Color_Dialog_Button_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "+"
(Widget : access Gtk_Color_Dialog_Button_Record'Class)
return Gtk.Constraint_Target.Gtk_Constraint_Target
function "-"
(Interf : Gtk.Accessible.Gtk_Accessible)
return Gtk_Color_Dialog_Button
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Color_Dialog_Button
function "-"
(Interf : Gtk.Constraint_Target.Gtk_Constraint_Target)
return Gtk_Color_Dialog_Button
procedure Announce
(Self : not null access Gtk_Color_Dialog_Button_Record;
Message : UTF8_String;
Priority : Gtk.Accessible.Gtk_Accessible_Announcement_Priority)
type Cb_GObject_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class);
type Cb_Gtk_Color_Dialog_Button_Void is not null access procedure
(Self : access Gtk_Color_Dialog_Button_Record'Class);
Dialog_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Color_Dialog.Gtk_Color_Dialog The GtkColorDialog that contains parameters for the color chooser dialog.
function Get_Accessible_Id
(Self : not null access Gtk_Color_Dialog_Button_Record)
return UTF8_String
function Get_Accessible_Parent
(Self : not null access Gtk_Color_Dialog_Button_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Accessible_Role
(Self : not null access Gtk_Color_Dialog_Button_Record)
return Gtk.Accessible.Gtk_Accessible_Role
function Get_At_Context
(Self : not null access Gtk_Color_Dialog_Button_Record)
return Gtk.Atcontext.Gtk_Atcontext
function Get_Bounds
(Self : not null access Gtk_Color_Dialog_Button_Record;
X : out Glib.Gint;
Y : out Glib.Gint;
Width : out Glib.Gint;
Height : out Glib.Gint) return Boolean
function Get_Dialog
(Self : not null access Gtk_Color_Dialog_Button_Record)
return Gtk.Color_Dialog.Gtk_Color_Dialog
Returns the GtkColorDialog of Self. Since: gtk+ 4.10
the GtkColorDialog. Has transfer-ownership='none'.
function Get_First_Accessible_Child
(Self : not null access Gtk_Color_Dialog_Button_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Next_Accessible_Sibling
(Self : not null access Gtk_Color_Dialog_Button_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Platform_State
(Self : not null access Gtk_Color_Dialog_Button_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State) return Boolean
function Get_Rgba
(Self : not null access Gtk_Color_Dialog_Button_Record)
return Gdk.RGBA.Gdk_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". Since: gtk+ 4.10
the color
function Get_Type return Glib.GType
type Gtk_Color_Dialog_Button is access all Gtk_Color_Dialog_Button_Record'Class;
function Gtk_Color_Dialog_Button_New
(Dialog : access Gtk.Color_Dialog.Gtk_Color_Dialog_Record'Class)
return Gtk_Color_Dialog_Button
Creates a new GtkColorDialogButton with the given GtkColorDialog. You can pass NULL to this function and set a GtkColorDialog later. The button will be insensitive until that happens. Since: gtk+ 4.10
the GtkColorDialog to use. Has transfer-ownership='full'.
type Gtk_Color_Dialog_Button_Record is new Gtk_Widget_Record with null record;
procedure Gtk_New
(Self : out Gtk_Color_Dialog_Button;
Dialog : access Gtk.Color_Dialog.Gtk_Color_Dialog_Record'Class)
Creates a new GtkColorDialogButton with the given GtkColorDialog. You can pass NULL to this function and set a GtkColorDialog later. The button will be insensitive until that happens. Since: gtk+ 4.10 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
the GtkColorDialog to use. Has transfer-ownership='full'.
package Implements_Gtk_Accessible is new Glib.Types.Implements
(Gtk.Accessible.Gtk_Accessible, Gtk_Color_Dialog_Button_Record, Gtk_Color_Dialog_Button);
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Color_Dialog_Button_Record, Gtk_Color_Dialog_Button);
package Implements_Gtk_Constraint_Target is new Glib.Types.Implements
(Gtk.Constraint_Target.Gtk_Constraint_Target, Gtk_Color_Dialog_Button_Record, Gtk_Color_Dialog_Button);
procedure Initialize
(Self : not null access Gtk_Color_Dialog_Button_Record'Class;
Dialog : access Gtk.Color_Dialog.Gtk_Color_Dialog_Record'Class)
Creates a new GtkColorDialogButton with the given GtkColorDialog. You can pass NULL to this function and set a GtkColorDialog later. The button will be insensitive until that happens. Since: gtk+ 4.10 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
the GtkColorDialog to use. Has transfer-ownership='full'.
procedure On_Activate
(Self : not null access Gtk_Color_Dialog_Button_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
Emitted when the color dialog button is activated.
The ::activate signal on GtkColorDialogButton is an action signal and emitting it causes the button to pop up its dialog.
procedure On_Activate
(Self : not null access Gtk_Color_Dialog_Button_Record;
Call : Cb_Gtk_Color_Dialog_Button_Void;
After : Boolean := False)
Emitted when the color dialog button is activated.
The ::activate signal on GtkColorDialogButton is an action signal and emitting it causes the button to pop up its dialog.
procedure Reset_Property
(Self : not null access Gtk_Color_Dialog_Button_Record;
Property : Gtk.Accessible.Gtk_Accessible_Property)
procedure Reset_Relation
(Self : not null access Gtk_Color_Dialog_Button_Record;
Relation : Gtk.Accessible.Gtk_Accessible_Relation)
procedure Reset_State
(Self : not null access Gtk_Color_Dialog_Button_Record;
State : Gtk.Accessible.Gtk_Accessible_State)
Rgba_Property : constant Gdk.RGBA.Property_RGBA;
Type: Gdk.RGBA.Gdk_RGBA 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::rgba to get informed about changes to the buttons color.
procedure Set_Accessible_Parent
(Self : not null access Gtk_Color_Dialog_Button_Record;
Parent : Gtk.Accessible.Gtk_Accessible;
Next_Sibling : Gtk.Accessible.Gtk_Accessible)
procedure Set_Dialog
(Self : not null access Gtk_Color_Dialog_Button_Record;
Dialog : not null access Gtk.Color_Dialog.Gtk_Color_Dialog_Record'Class)
Sets a GtkColorDialog object to use for creating the color chooser dialog that is presented when the user clicks the button. Since: gtk+ 4.10
the new GtkColorDialog
procedure Set_Rgba
(Self : not null access Gtk_Color_Dialog_Button_Record;
Color : Gdk.RGBA.Gdk_RGBA)
Sets the color of the button. Since: gtk+ 4.10
the new color
Signal_Activate : constant Glib.Signal_Name := "activate";
Emitted when the color dialog button is activated.
The ::activate signal on GtkColorDialogButton is an action signal and emitting it causes the button to pop up its dialog.
procedure Update_Next_Accessible_Sibling
(Self : not null access Gtk_Color_Dialog_Button_Record;
New_Sibling : Gtk.Accessible.Gtk_Accessible)
procedure Update_Platform_State
(Self : not null access Gtk_Color_Dialog_Button_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State)