Gtk.Color_Chooser.Gtk_Color_Chooser is an interface that is implemented by widgets for choosing colors. Depending on the situation, colors may be allowed to have alpha (translucency).
In GTK+, the main widgets that implement this interface are Gtk.Color_Chooser_Widget.Gtk_Color_Chooser_Widget, Gtk.Color_Chooser_Dialog.Gtk_Color_Chooser_Dialog and Gtk.Color_Button.Gtk_Color_Button.
function "+" (W : Gtk_Color_Chooser) return Gtk_Color_Chooser
procedure Add_Palette
(Self : Gtk_Color_Chooser;
Orientation : Gtk.Enums.Gtk_Orientation;
Colors_Per_Line : Glib.Gint;
N_Colors : Glib.Gint;
Colors : array_of_Gdk_RGBA)
Adds a palette to the color chooser. If Orientation is horizontal, the colors are grouped in rows, with Colors_Per_Line colors in each row. If Horizontal is False, the colors are grouped in columns instead. The default color palette of Gtk.Color_Chooser_Widget.Gtk_Color_Chooser_Widget has 27 colors, organized in columns of 3 colors. The default gray palette has 9 grays in a single row. The layout of the color chooser widget works best when the palettes have 9-10 columns. Calling this function for the first time has the side effect of removing the default color and gray palettes from the color chooser. If Colors is null, removes all previously added palettes. Since: gtk+ 3.4
Gtk.Enums.Orientation_Horizontal if the palette should be displayed in rows, Gtk.Enums.Orientation_Vertical for columns
the number of colors to show in each row/column
the total number of elements in Colors
the colors of the palette, or null
type Cb_GObject_Gdk_RGBA_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class;
Color : Gdk.RGBA.Gdk_RGBA);
type Cb_Gtk_Color_Chooser_Gdk_RGBA_Void is not null access procedure
(Self : Gtk_Color_Chooser;
Color : Gdk.RGBA.Gdk_RGBA);
subtype Color_Chooser_Interface_Descr is Glib.Object.Interface_Description;
procedure Get_Rgba
(Self : Gtk_Color_Chooser;
Color : out Gdk.RGBA.Gdk_RGBA)
Gets the currently-selected color. Since: gtk+ 3.4
a Gdk.RGBA.Gdk_RGBA to fill in with the current color
function Get_Type return Glib.GType
function Get_Use_Alpha (Self : Gtk_Color_Chooser) return Boolean
Returns whether the color chooser shows the alpha channel. Since: gtk+ 3.4
True if the color chooser uses the alpha channel, False if not
type Gtk_Color_Chooser is new Glib.Types.GType_Interface;
Null_Gtk_Color_Chooser : constant Gtk_Color_Chooser;
procedure On_Color_Activated
(Self : Gtk_Color_Chooser;
Call : Cb_GObject_Gdk_RGBA_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
Emitted when a color is activated from the color chooser. This usually happens when the user clicks a color swatch, or a color is selected and the user presses one of the keys Space, Shift+Space, Return or Enter.
procedure On_Color_Activated
(Self : Gtk_Color_Chooser;
Call : Cb_Gtk_Color_Chooser_Gdk_RGBA_Void;
After : Boolean := False)
Emitted when a color is activated from the color chooser. This usually happens when the user clicks a color swatch, or a color is selected and the user presses one of the keys Space, Shift+Space, Return or Enter.
Rgba_Property : constant Gdk.RGBA.Property_RGBA;
Type: Gdk.RGBA.Gdk_RGBA The ::rgba property contains the currently selected color, as a Gdk.RGBA.Gdk_RGBA struct. The property can be set to change the current selection programmatically.
procedure Set_Add_Palette
(Self : Color_Chooser_Interface_Descr;
Handler : Virtual_Add_Palette)
procedure Set_Color_Activated
(Self : Color_Chooser_Interface_Descr;
Handler : Virtual_Color_Activated)
procedure Set_Get_Rgba
(Self : Color_Chooser_Interface_Descr;
Handler : Virtual_Get_Rgba)
procedure Set_Rgba (Self : Gtk_Color_Chooser; Color : Gdk.RGBA.Gdk_RGBA)
Sets the color. Since: gtk+ 3.4
the new color
procedure Set_Set_Rgba
(Self : Color_Chooser_Interface_Descr;
Handler : Virtual_Set_Rgba)
See Glib.Object.Add_Interface
procedure Set_Use_Alpha (Self : Gtk_Color_Chooser; Use_Alpha : Boolean)
Sets whether or not the color chooser should use the alpha channel. Since: gtk+ 3.4
True if color chooser should use alpha channel, False if not
Signal_Color_Activated : constant Glib.Signal_Name := "color-activated";
Emitted when a color is activated from the color chooser. This usually happens when the user clicks a color swatch, or a color is selected and the user presses one of the keys Space, Shift+Space, Return or Enter.
Use_Alpha_Property : constant Glib.Properties.Property_Boolean;
When ::use-alpha is True, colors may have alpha (translucency) information. When it is False, the Gdk.RGBA.Gdk_RGBA struct obtained via the Gtk.Color_Chooser.Gtk_Color_Chooser:rgba property will be forced to have alpha == 1.
Implementations are expected to show alpha by rendering the color over a non-uniform background (like a checkerboard pattern).
type Virtual_Add_Palette is access procedure
(Self : Gtk_Color_Chooser;
Orientation : Gtk.Enums.Gtk_Orientation;
Colors_Per_Line : Glib.Gint;
N_Colors : Glib.Gint;
Colors : array_of_Gdk_RGBA);
Adds a palette to the color chooser. If Orientation is horizontal, the colors are grouped in rows, with Colors_Per_Line colors in each row. If Horizontal is False, the colors are grouped in columns instead. The default color palette of Gtk.Color_Chooser_Widget.Gtk_Color_Chooser_Widget has 27 colors, organized in columns of 3 colors. The default gray palette has 9 grays in a single row. The layout of the color chooser widget works best when the palettes have 9-10 columns. Calling this function for the first time has the side effect of removing the default color and gray palettes from the color chooser. If Colors is null, removes all previously added palettes. Since: gtk+ 3.4
Gtk.Enums.Orientation_Horizontal if the palette should be displayed in rows, Gtk.Enums.Orientation_Vertical for columns
the number of colors to show in each row/column
the total number of elements in Colors
the colors of the palette, or null
type Virtual_Color_Activated is access procedure (Self : Gtk_Color_Chooser; Color : Gdk.RGBA.Gdk_RGBA);
type Virtual_Get_Rgba is access procedure (Self : Gtk_Color_Chooser; Color : out Gdk.RGBA.Gdk_RGBA);
Gets the currently-selected color. Since: gtk+ 3.4
a Gdk.RGBA.Gdk_RGBA to fill in with the current color
type Virtual_Set_Rgba is access procedure (Self : Gtk_Color_Chooser; Color : Gdk.RGBA.Gdk_RGBA);
Sets the color. Since: gtk+ 3.4
the new color