The Gtk.Color_Chooser_Widget.Gtk_Color_Chooser_Widget widget lets the user select a color. By default, the chooser presents a predefined palette of colors, plus a small number of settable custom colors. It is also possible to select a different color with the single-color editor. To enter the single-color editing mode, use the context menu of any color of the palette, or use the '+' button to add a new custom color.
The chooser automatically remembers the last selection, as well as custom colors.
To change the initially selected color, use Gtk.Color_Chooser.Set_Rgba. To get the selected color use Gtk.Color_Chooser.Get_Rgba.
The Gtk.Color_Chooser_Widget.Gtk_Color_Chooser_Widget is used in the Gtk.Color_Chooser_Dialog.Gtk_Color_Chooser_Dialog to provide a dialog for selecting colors.
# CSS names
GtkColorChooserWidget has a single CSS node with name colorchooser.
function "+"
(Widget : access Gtk_Color_Chooser_Widget_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "+"
(Widget : access Gtk_Color_Chooser_Widget_Record'Class)
return Gtk.Color_Chooser.Gtk_Color_Chooser
function "+"
(Widget : access Gtk_Color_Chooser_Widget_Record'Class)
return Gtk.Orientable.Gtk_Orientable
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Color_Chooser_Widget
function "-"
(Interf : Gtk.Color_Chooser.Gtk_Color_Chooser)
return Gtk_Color_Chooser_Widget
function "-"
(Interf : Gtk.Orientable.Gtk_Orientable)
return Gtk_Color_Chooser_Widget
procedure Add_Palette
(Self : not null access Gtk_Color_Chooser_Widget_Record;
Orientation : Gtk.Enums.Gtk_Orientation;
Colors_Per_Line : Glib.Gint;
N_Colors : Glib.Gint;
Colors : array_of_Gdk_RGBA)
function Get_Orientation
(Self : not null access Gtk_Color_Chooser_Widget_Record)
return Gtk.Enums.Gtk_Orientation
procedure Get_Rgba
(Self : not null access Gtk_Color_Chooser_Widget_Record;
Color : out Gdk.RGBA.Gdk_RGBA)
function Get_Type return Glib.GType
function Get_Use_Alpha
(Self : not null access Gtk_Color_Chooser_Widget_Record)
return Boolean
type Gtk_Color_Chooser_Widget is access all Gtk_Color_Chooser_Widget_Record'Class;
function Gtk_Color_Chooser_Widget_New return Gtk_Color_Chooser_Widget
Creates a new Gtk.Color_Chooser_Widget.Gtk_Color_Chooser_Widget. Since: gtk+ 3.4
type Gtk_Color_Chooser_Widget_Record is new Gtk_Box_Record with null record;
procedure Gtk_New (Self : out Gtk_Color_Chooser_Widget)
Creates a new Gtk.Color_Chooser_Widget.Gtk_Color_Chooser_Widget. Since: gtk+ 3.4 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Color_Chooser_Widget_Record, Gtk_Color_Chooser_Widget);
package Implements_Gtk_Color_Chooser is new Glib.Types.Implements
(Gtk.Color_Chooser.Gtk_Color_Chooser, Gtk_Color_Chooser_Widget_Record, Gtk_Color_Chooser_Widget);
package Implements_Gtk_Orientable is new Glib.Types.Implements
(Gtk.Orientable.Gtk_Orientable, Gtk_Color_Chooser_Widget_Record, Gtk_Color_Chooser_Widget);
procedure Initialize
(Self : not null access Gtk_Color_Chooser_Widget_Record'Class)
Creates a new Gtk.Color_Chooser_Widget.Gtk_Color_Chooser_Widget. Since: gtk+ 3.4 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Set_Orientation
(Self : not null access Gtk_Color_Chooser_Widget_Record;
Orientation : Gtk.Enums.Gtk_Orientation)
procedure Set_Rgba
(Self : not null access Gtk_Color_Chooser_Widget_Record;
Color : Gdk.RGBA.Gdk_RGBA)
procedure Set_Use_Alpha
(Self : not null access Gtk_Color_Chooser_Widget_Record;
Use_Alpha : Boolean)
Show_Editor_Property : constant Glib.Properties.Property_Boolean;
The ::show-editor property is True when the color chooser is showing the single-color editor. It can be set to switch the color chooser into single-color editing mode.