Gtk.Color_Chooser

Entities

Simple Types

Access Types

Subtypes

Constants

Subprograms

Description

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
Parameters
W
Return Value

Add_Palette

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

Parameters
Self
Orientation

Gtk.Enums.Orientation_Horizontal if the palette should be displayed in rows, Gtk.Enums.Orientation_Vertical for columns

Colors_Per_Line

the number of colors to show in each row/column

N_Colors

the total number of elements in Colors

Colors

the colors of the palette, or null

Cb_GObject_Gdk_RGBA_Void

type Cb_GObject_Gdk_RGBA_Void is not null access procedure
  (Self  : access Glib.Object.GObject_Record'Class;
   Color : Gdk.RGBA.Gdk_RGBA);
Parameters
Self
Color

Cb_Gtk_Color_Chooser_Gdk_RGBA_Void

type Cb_Gtk_Color_Chooser_Gdk_RGBA_Void is not null access procedure
  (Self  : Gtk_Color_Chooser;
   Color : Gdk.RGBA.Gdk_RGBA);
Parameters
Self
Color

Color_Chooser_Interface_Descr

subtype Color_Chooser_Interface_Descr is Glib.Object.Interface_Description;

Get_Rgba

procedure Get_Rgba
   (Self  : Gtk_Color_Chooser;
    Color : out Gdk.RGBA.Gdk_RGBA)

Gets the currently-selected color. Since: gtk+ 3.4

Parameters
Self
Color

a Gdk.RGBA.Gdk_RGBA to fill in with the current color

Get_Type

function Get_Type return Glib.GType
Return Value

Get_Use_Alpha

function Get_Use_Alpha (Self : Gtk_Color_Chooser) return Boolean

Returns whether the color chooser shows the alpha channel. Since: gtk+ 3.4

Parameters
Self
Return Value

True if the color chooser uses the alpha channel, False if not

Gtk_Color_Chooser

type Gtk_Color_Chooser is new Glib.Types.GType_Interface;

Null_Gtk_Color_Chooser

Null_Gtk_Color_Chooser : constant Gtk_Color_Chooser;

On_Color_Activated

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.

Parameters
Self
Call
Slot
After

On_Color_Activated

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.

Parameters
Self
Call
After

Rgba_Property

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.

Set_Add_Palette

procedure Set_Add_Palette
  (Self    : Color_Chooser_Interface_Descr;
   Handler : Virtual_Add_Palette)
Parameters
Self
Handler

Set_Color_Activated

procedure Set_Color_Activated
  (Self    : Color_Chooser_Interface_Descr;
   Handler : Virtual_Color_Activated)
Parameters
Self
Handler

Set_Get_Rgba

procedure Set_Get_Rgba
  (Self    : Color_Chooser_Interface_Descr;
   Handler : Virtual_Get_Rgba)
Parameters
Self
Handler

Set_Rgba

procedure Set_Rgba (Self : Gtk_Color_Chooser; Color : Gdk.RGBA.Gdk_RGBA)

Sets the color. Since: gtk+ 3.4

Parameters
Self
Color

the new color

Set_Set_Rgba

procedure Set_Set_Rgba
  (Self    : Color_Chooser_Interface_Descr;
   Handler : Virtual_Set_Rgba)

See Glib.Object.Add_Interface

Parameters
Self
Handler

Set_Use_Alpha

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

Parameters
Self
Use_Alpha

True if color chooser should use alpha channel, False if not

Signal_Color_Activated

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

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).

Virtual_Add_Palette

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

Parameters
Self
Orientation

Gtk.Enums.Orientation_Horizontal if the palette should be displayed in rows, Gtk.Enums.Orientation_Vertical for columns

Colors_Per_Line

the number of colors to show in each row/column

N_Colors

the total number of elements in Colors

Colors

the colors of the palette, or null

Virtual_Color_Activated

type Virtual_Color_Activated is access procedure (Self : Gtk_Color_Chooser; Color : Gdk.RGBA.Gdk_RGBA);
Parameters
Self
Color

Virtual_Get_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

Parameters
Self
Color

a Gdk.RGBA.Gdk_RGBA to fill in with the current color

Virtual_Set_Rgba

type Virtual_Set_Rgba is access procedure (Self : Gtk_Color_Chooser; Color : Gdk.RGBA.Gdk_RGBA);

Sets the color. Since: gtk+ 3.4

Parameters
Self
Color

the new color