A Gtk_Color_Selection widget is a complex dialog that allows the user to select a color based either on its (Red, Green, Blue) or its (Hue, Saturation, Value). An additional field is provided to select the opacity of the color (this is usually called the alpha channel).
See Gtk.Color_Selection_Dialog for a version of this widget that comes with its own dialog.
See Gtk.Extra.Color_Combo for a different way to select colors.
<screenshot>gtk-colorsel</screenshot> <group>Drawing</group> <testgtk>create_color_selection.adb</testgtk>
function "+"
(Widget : access Gtk_Color_Selection_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "+"
(Widget : access Gtk_Color_Selection_Record'Class)
return Gtk.Orientable.Gtk_Orientable
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Color_Selection
function "-"
(Interf : Gtk.Orientable.Gtk_Orientable)
return Gtk_Color_Selection
type Cb_GObject_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class);
type Cb_Gtk_Color_Selection_Void is not null access procedure
(Self : access Gtk_Color_Selection_Record'Class);
Current_Alpha_Property : constant Glib.Properties.Property_Uint;
Current_Color_Property : constant Gdk.Color.Property_Gdk_Color;
Type: Gdk.Color.Gdk_Color The current GdkColor color.
Current_Rgba_Property : constant Gdk.RGBA.Property_RGBA;
Type: Gdk.RGBA.Gdk_RGBA The current RGBA color.
function Get_Current_Alpha
(Colorsel : not null access Gtk_Color_Selection_Record) return Guint16
Returns the current alpha value.
an integer between 0 and 65535
procedure Get_Current_Color
(Colorsel : not null access Gtk_Color_Selection_Record;
Color : out Gdk.Color.Gdk_Color)
Sets Color to be the current color in the GtkColorSelection widget. Deprecated since 3.4, 1
a Gdk.Color.Gdk_Color to fill in with the current color
procedure Get_Current_Rgba
(Colorsel : not null access Gtk_Color_Selection_Record;
Rgba : out Gdk.RGBA.Gdk_RGBA)
Sets Rgba to be the current color in the GtkColorSelection widget. Since: gtk+ 3.0
a Gdk.RGBA.Gdk_RGBA to fill in with the current color
function Get_Has_Opacity_Control
(Colorsel : not null access Gtk_Color_Selection_Record) return Boolean
Determines whether the colorsel has an opacity control.
True if the Colorsel has an opacity control, False if it does't
function Get_Has_Palette
(Colorsel : not null access Gtk_Color_Selection_Record) return Boolean
Determines whether the color selector has a color palette.
True if the selector has a palette, False if it hasn't
function Get_Orientation
(Self : not null access Gtk_Color_Selection_Record)
return Gtk.Enums.Gtk_Orientation
function Get_Previous_Alpha
(Colorsel : not null access Gtk_Color_Selection_Record) return Guint16
Returns the previous alpha value.
an integer between 0 and 65535
procedure Get_Previous_Color
(Colorsel : not null access Gtk_Color_Selection_Record;
Color : out Gdk.Color.Gdk_Color)
Fills Color in with the original color value. Deprecated since 3.4, 1
a Gdk.Color.Gdk_Color to fill in with the original color value
procedure Get_Previous_Rgba
(Colorsel : not null access Gtk_Color_Selection_Record;
Rgba : out Gdk.RGBA.Gdk_RGBA)
Fills Rgba in with the original color value. Since: gtk+ 3.0
a Gdk.RGBA.Gdk_RGBA to fill in with the original color value
function Get_Type return Glib.GType
type Gtk_Color_Selection is access all Gtk_Color_Selection_Record'Class;
type Gtk_Color_Selection_Change_Palette_With_Screen_Func is access procedure
(Screen : System.Address
Colors : Gdk.Color.Gdk_Color_Unconstrained_Array;
N_Colors : Gint);
This function should save the new palette contents, and update the Gtk_Settings property "gtk-color-palette" so all Gtk_Color_Selection widgets will be modified, including the current one. For instance, you would do: Set_String_Property (Get_Default, Gtk_Color_Palette, Palette_To_String (Colors), "Foo");
Convert to Gdk_Screen with Get_User_Data
function Gtk_Color_Selection_New return Gtk_Color_Selection
Creates a new GtkColorSelection.
type Gtk_Color_Selection_Record is new Gtk_Box_Record with null record;
procedure Gtk_New (Colorsel : out Gtk_Color_Selection)
Creates a new GtkColorSelection. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
Has_Opacity_Control_Property : constant Glib.Properties.Property_Boolean;
Has_Palette_Property : constant Glib.Properties.Property_Boolean;
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Color_Selection_Record, Gtk_Color_Selection);
package Implements_Gtk_Orientable is new Glib.Types.Implements
(Gtk.Orientable.Gtk_Orientable, Gtk_Color_Selection_Record, Gtk_Color_Selection);
procedure Initialize
(Colorsel : not null access Gtk_Color_Selection_Record'Class)
Creates a new GtkColorSelection. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
function Is_Adjusting
(Colorsel : not null access Gtk_Color_Selection_Record) return Boolean
Gets the current state of the Colorsel.
True if the user is currently dragging a color around, and False if the selection has stopped
procedure On_Color_Changed
(Self : not null access Gtk_Color_Selection_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
This signal is emitted when the color changes in the Gtk.Color_Selection.Gtk_Color_Selection according to its update policy.
procedure On_Color_Changed
(Self : not null access Gtk_Color_Selection_Record;
Call : Cb_Gtk_Color_Selection_Void;
After : Boolean := False)
This signal is emitted when the color changes in the Gtk.Color_Selection.Gtk_Color_Selection according to its update policy.
function Palette_From_String
(Str : String) return Gdk.Color.Gdk_Color_Array
Parses a color palette string. This string is a colon-separated list of color names readable by Gdk.Color.Parse. An empty array is returned if Str couldn't be parsed
function Palette_To_String
(Colors : Gdk.Color.Gdk_Color_Array) return String
Encodes a palette as a string, useful for persistent storage.
procedure Set_Change_Palette_With_Screen_Hook
(Func : Gtk_Color_Selection_Change_Palette_With_Screen_Func)
Installs a global function to be called whenever the user tries to modify the palette in a color selection. This function should save the new palette contents, and update the Gtk.Settings.Gtk_Settings:gtk-color-palette GtkSettings property so all GtkColorSelection widgets will be modified. Since: gtk+ 2.2
a function to call when the custom palette needs saving @return the previous change palette hook (that was replaced)
procedure Set_Current_Alpha
(Colorsel : not null access Gtk_Color_Selection_Record;
Alpha : Guint16)
Sets the current opacity to be Alpha. The first time this is called, it will also set the original opacity to be Alpha too.
an integer between 0 and 65535
procedure Set_Current_Color
(Colorsel : not null access Gtk_Color_Selection_Record;
Color : Gdk.Color.Gdk_Color)
Sets the current color to be Color. The first time this is called, it will also set the original color to be Color too. Deprecated since 3.4, 1
a Gdk.Color.Gdk_Color to set the current color with
procedure Set_Current_Rgba
(Colorsel : not null access Gtk_Color_Selection_Record;
Rgba : Gdk.RGBA.Gdk_RGBA)
Sets the current color to be Rgba. The first time this is called, it will also set the original color to be Rgba too. Since: gtk+ 3.0
A Gdk.RGBA.Gdk_RGBA to set the current color with
procedure Set_Has_Opacity_Control
(Colorsel : not null access Gtk_Color_Selection_Record;
Has_Opacity : Boolean)
Sets the Colorsel to use or not use opacity.
True if Colorsel can set the opacity, False otherwise
procedure Set_Has_Palette
(Colorsel : not null access Gtk_Color_Selection_Record;
Has_Palette : Boolean)
Shows and hides the palette based upon the value of Has_Palette.
True if palette is to be visible, False otherwise
procedure Set_Orientation
(Self : not null access Gtk_Color_Selection_Record;
Orientation : Gtk.Enums.Gtk_Orientation)
procedure Set_Previous_Alpha
(Colorsel : not null access Gtk_Color_Selection_Record;
Alpha : Guint16)
Sets the "previous" alpha to be Alpha. This function should be called with some hesitations, as it might seem confusing to have that alpha change.
an integer between 0 and 65535
procedure Set_Previous_Color
(Colorsel : not null access Gtk_Color_Selection_Record;
Color : Gdk.Color.Gdk_Color)
Sets the "previous" color to be Color. This function should be called with some hesitations, as it might seem confusing to have that color change. Calling Gtk.Color_Selection.Set_Current_Color will also set this color the first time it is called. Deprecated since 3.4, 1
a Gdk.Color.Gdk_Color to set the previous color with
procedure Set_Previous_Rgba
(Colorsel : not null access Gtk_Color_Selection_Record;
Rgba : Gdk.RGBA.Gdk_RGBA)
Sets the "previous" color to be Rgba. This function should be called with some hesitations, as it might seem confusing to have that color change. Calling Gtk.Color_Selection.Set_Current_Rgba will also set this color the first time it is called. Since: gtk+ 3.0
a Gdk.RGBA.Gdk_RGBA to set the previous color with
Signal_Color_Changed : constant Glib.Signal_Name := "color-changed";
This signal is emitted when the color changes in the Gtk.Color_Selection.Gtk_Color_Selection according to its update policy.