Gtk.Color_Selection

Entities

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

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

"+"

function "+"
  (Widget : access Gtk_Color_Selection_Record'Class)
return Gtk.Orientable.Gtk_Orientable
Parameters
Widget
Return Value

"-"

function "-"
  (Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Color_Selection
Parameters
Interf
Return Value

"-"

function "-"
  (Interf : Gtk.Orientable.Gtk_Orientable)
return Gtk_Color_Selection
Parameters
Interf
Return Value

Cb_GObject_Void

type Cb_GObject_Void is not null access procedure
  (Self : access Glib.Object.GObject_Record'Class);
Parameters
Self

Cb_Gtk_Color_Selection_Void

type Cb_Gtk_Color_Selection_Void is not null access procedure
  (Self : access Gtk_Color_Selection_Record'Class);
Parameters
Self

Current_Alpha_Property

Current_Alpha_Property : constant Glib.Properties.Property_Uint;

Current_Color_Property

Current_Color_Property : constant Gdk.Color.Property_Gdk_Color;

Type: Gdk.Color.Gdk_Color The current GdkColor color.

Current_Rgba_Property

Current_Rgba_Property : constant Gdk.RGBA.Property_RGBA;

Type: Gdk.RGBA.Gdk_RGBA The current RGBA color.

Get_Current_Alpha

function Get_Current_Alpha
   (Colorsel : not null access Gtk_Color_Selection_Record) return Guint16

Returns the current alpha value.

Parameters
Colorsel
Return Value

an integer between 0 and 65535

Get_Current_Color

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

Parameters
Colorsel
Color

a Gdk.Color.Gdk_Color to fill in with the current color

Get_Current_Rgba

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

Parameters
Colorsel
Rgba

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

Get_Has_Opacity_Control

function Get_Has_Opacity_Control
   (Colorsel : not null access Gtk_Color_Selection_Record) return Boolean

Determines whether the colorsel has an opacity control.

Parameters
Colorsel
Return Value

True if the Colorsel has an opacity control, False if it does't

Get_Has_Palette

function Get_Has_Palette
   (Colorsel : not null access Gtk_Color_Selection_Record) return Boolean

Determines whether the color selector has a color palette.

Parameters
Colorsel
Return Value

True if the selector has a palette, False if it hasn't

Get_Orientation

function Get_Orientation
   (Self : not null access Gtk_Color_Selection_Record)
    return Gtk.Enums.Gtk_Orientation
Parameters
Self
Return Value

Get_Previous_Alpha

function Get_Previous_Alpha
   (Colorsel : not null access Gtk_Color_Selection_Record) return Guint16

Returns the previous alpha value.

Parameters
Colorsel
Return Value

an integer between 0 and 65535

Get_Previous_Color

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

Parameters
Colorsel
Color

a Gdk.Color.Gdk_Color to fill in with the original color value

Get_Previous_Rgba

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

Parameters
Colorsel
Rgba

a Gdk.RGBA.Gdk_RGBA to fill in with the original color value

Get_Type

function Get_Type return Glib.GType
Return Value

Gtk_Color_Selection

type Gtk_Color_Selection is access all Gtk_Color_Selection_Record'Class;

Gtk_Color_Selection_Change_Palette_With_Screen_Func

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");

Parameters
Screen

Convert to Gdk_Screen with Get_User_Data

Colors
N_Colors

Gtk_Color_Selection_New

function Gtk_Color_Selection_New return Gtk_Color_Selection

Creates a new GtkColorSelection.

Return Value

Gtk_Color_Selection_Record

type Gtk_Color_Selection_Record is new Gtk_Box_Record with null record;

Gtk_New

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.

Parameters
Colorsel

Has_Opacity_Control_Property

Has_Opacity_Control_Property : constant Glib.Properties.Property_Boolean;

Has_Palette_Property

Has_Palette_Property : constant Glib.Properties.Property_Boolean;

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Color_Selection_Record, Gtk_Color_Selection);

Implements_Gtk_Orientable

package Implements_Gtk_Orientable is new Glib.Types.Implements
  (Gtk.Orientable.Gtk_Orientable, Gtk_Color_Selection_Record, Gtk_Color_Selection);

Initialize

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.

Parameters
Colorsel

Is_Adjusting

function Is_Adjusting
   (Colorsel : not null access Gtk_Color_Selection_Record) return Boolean

Gets the current state of the Colorsel.

Parameters
Colorsel
Return Value

True if the user is currently dragging a color around, and False if the selection has stopped

On_Color_Changed

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.

Parameters
Self
Call
Slot
After

On_Color_Changed

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.

Parameters
Self
Call
After

Palette_From_String

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

Parameters
Str
Return Value

Palette_To_String

function Palette_To_String
  (Colors   : Gdk.Color.Gdk_Color_Array) return String

Encodes a palette as a string, useful for persistent storage.

Parameters
Colors
Return Value

Set_Change_Palette_With_Screen_Hook

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

Parameters
Func

a function to call when the custom palette needs saving @return the previous change palette hook (that was replaced)

Set_Current_Alpha

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.

Parameters
Colorsel
Alpha

an integer between 0 and 65535

Set_Current_Color

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

Parameters
Colorsel
Color

a Gdk.Color.Gdk_Color to set the current color with

Set_Current_Rgba

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

Parameters
Colorsel
Rgba

A Gdk.RGBA.Gdk_RGBA to set the current color with

Set_Has_Opacity_Control

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.

Parameters
Colorsel
Has_Opacity

True if Colorsel can set the opacity, False otherwise

Set_Has_Palette

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.

Parameters
Colorsel
Has_Palette

True if palette is to be visible, False otherwise

Set_Orientation

procedure Set_Orientation
   (Self        : not null access Gtk_Color_Selection_Record;
    Orientation : Gtk.Enums.Gtk_Orientation)
Parameters
Self
Orientation

Set_Previous_Alpha

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.

Parameters
Colorsel
Alpha

an integer between 0 and 65535

Set_Previous_Color

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

Parameters
Colorsel
Color

a Gdk.Color.Gdk_Color to set the previous color with

Set_Previous_Rgba

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

Parameters
Colorsel
Rgba

a Gdk.RGBA.Gdk_RGBA to set the previous color with

Signal_Color_Changed

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.