Toc Gallery Index Tree Gtk.Color_Button

Screenshot

No screeshot

Hierarchy

Description

The Gtk_Color_Button is a button which displays the currently selected color an allows to open a color selection dialog to change the color. It is suitable widget for selecting a color in a preference dialog.

Types

  • type Gtk_Color_Button is access all Gtk_Color_Button_Record'Class;
  • type Gtk_Color_Button_Record is new Gtk.Button.Gtk_Button_Record with null record;

Subprograms

  • function Get_Type return Gtk.Gtk_Type;
    Return the internal value associated with a Gtk_Color_Button.
  • procedure Gtk_New (Button : out Gtk_Color_Button);
    procedure Initialize (Button : access Gtk_Color_Button_Record'Class);
    Creates a new color button. This returns a widget in the form of a small button containing a swatch representing the current selected color. When the button is clicked, a color-selection dialog will open, allowing the user to select a color. The swatch will be updated to reflect the new color when the user finishes.
  • procedure Gtk_New_With_Color (Button : out Gtk_Color_Button; Color : Gdk.Color.Gdk_Color);
    procedure Initialize_With_Color (Button : access Gtk_Color_Button_Record'Class; Color : Gdk.Color.Gdk_Color);
    Creates a new color button.
  • procedure Set_Color (Button : access Gtk_Color_Button_Record; Color : Gdk.Color.Gdk_Color);
    function Get_Color (Button : access Gtk_Color_Button_Record) return Gdk.Color.Gdk_Color;
    Sets the current color to be Color.
  • procedure Set_Alpha (Button : access Gtk_Color_Button_Record; Alpha : Guint16);
    function Get_Alpha (Button : access Gtk_Color_Button_Record) return Glib.Guint16;
    Sets the current opacity to be Alpha (0 to 65_535).
  • procedure Set_Use_Alpha (Button : access Gtk_Color_Button_Record; Use_Alpha : Boolean);
    function Get_Use_Alpha (Button : access Gtk_Color_Button_Record) return Boolean;
    Sets whether or not the color button should use the alpha channel.
  • procedure Set_Title (Button : access Gtk_Color_Button_Record; Title : String);
    function Get_Title (Button : access Gtk_Color_Button_Record) return String;
    Sets the title for the color selection dialog.

Signals

  • color_set
    procedure Handler (Button : access Gtk_Color_Button_Record'Class);
    The color-set signal is emitted when the user selects a color. When handling this signal, use Get_Color and Get_Alpha to find out which color was just selected. Note that this signal is only emitted when the user changes the color. If you need to react to programmatic color changes as well, use the notify::color signal.

Properties

  • Alpha_Property
    Uint
    The selected opacity value
  • Color_Property
    Boxed
    The selected color
  • Title_Property
    String
    The title of the color selection dialog
  • Use_Alpha_Property
    Boolean
    Whether or not to give the color an alpha value

Alphabetical Index