type Gtk_Color_Selection_Record is new Gtk.Box.Gtk_Box_Record with private;
type Gtk_Color_Selection is access all Gtk_Color_Selection_Record'Class;
type Color_Index is (Red, Green, Blue, Opacity);
type Color_Array is array (Color_Index) of Gdouble;
type Gtk_Color_Selection_Change_Palette_With_Screen_Func is access procedure (Screen : Gdk.Gdk_Screen; Colors : Gdk.Color.Gdk_Color_Array);
Current_Alpha_Property : constant Glib.Properties.Property_Uint;
Has_Opacity_Control_Property : constant Glib.Properties.Property_Boolean;
Has_Palette_Property : constant Glib.Properties.Property_Boolean;
Signal_Color_Changed : constant Glib.Signal_Name := "color_changed";
procedure Gtk_New
( | Widget | : out Gtk_Color_Selection); |
procedure Initialize
( | Widget | : access Gtk_Color_Selection_Record'Class); |
function Get_Type return Glib.GType;
procedure Set_Current_Color
( | Colorsel | : access Gtk_Color_Selection_Record; |
Color | : Gdk.Color.Gdk_Color); |
procedure Get_Current_Color
( | Colorsel | : access Gtk_Color_Selection_Record; |
Color | : out Gdk.Color.Gdk_Color); |
procedure Set_Previous_Color
( | Colorsel | : access Gtk_Color_Selection_Record; |
Color | : Gdk.Color.Gdk_Color); |
procedure Get_Previous_Color
( | Colorsel | : access Gtk_Color_Selection_Record; |
Color | : out Gdk.Color.Gdk_Color); |
function Is_Adjusting
( | Colorsel | : access Gtk_Color_Selection_Record) return Boolean; |
procedure Set_Has_Opacity_Control
( | Colorsel | : access Gtk_Color_Selection_Record; |
Has_Opacity | : Boolean); |
function Get_Has_Opacity_Control
( | Colorsel | : access Gtk_Color_Selection_Record) return Boolean; |
procedure Set_Previous_Alpha
( | Colorsel | : access Gtk_Color_Selection_Record; |
Alpha | : Guint16); |
function Get_Previous_Alpha
( | Colorsel | : access Gtk_Color_Selection_Record) return Guint16; |
procedure Set_Current_Alpha
( | Colorsel | : access Gtk_Color_Selection_Record; |
Alpha | : Guint16); |
function Get_Current_Alpha
( | Colorsel | : access Gtk_Color_Selection_Record) return Guint16; |
procedure Set_Has_Palette
( | Colorsel | : access Gtk_Color_Selection_Record; |
Has_Palette | : Boolean); |
function Get_Has_Palette
( | Colorsel | : access Gtk_Color_Selection_Record) return Boolean; |
function Palette_From_String
( | Str | : String) return Gdk.Color.Gdk_Color_Array; |
function Palette_To_String
( | Colors | : Gdk.Color.Gdk_Color_Array) return String; |
function Set_Change_Palette_With_Screen_Hook
( | Func | : Gtk_Color_Selection_Change_Palette_With_Screen_Func) return Gtk_Color_Selection_Change_Palette_With_Screen_Func; |
procedure Set_Update_Policy
( | Colorsel | : access Gtk_Color_Selection_Record; |
Policy | : Enums.Gtk_Update_Type); |
procedure Set_Color
( | Colorsel | : access Gtk_Color_Selection_Record; |
Color | : Color_Array); |
procedure Get_Color
( | Colorsel | : access Gtk_Color_Selection_Record; |
Color | : out Color_Array); |
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.
Binding from C File version 2.8.17
<testgtk>create_color_selection.adb</testgtk>