## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

1.     -----------------------------------------------------------------------

2.     --              GtkAda - Ada95 binding for Gtk+/Gnome                --

3.     --                                                                   --

4.     --                Copyright (C) 2006-2007 AdaCore                    --

5.     --                                                                   --

6.     -- This library is free software; you can redistribute it and/or     --

7.     -- modify it under the terms of the GNU General Public               --

8.     -- License as published by the Free Software Foundation; either      --

9.     -- version 2 of the License, or (at your option) any later version.  --

10.     --                                                                   --

11.     -- This library is distributed in the hope that it will be useful,   --

12.     -- but WITHOUT ANY WARRANTY; without even the implied warranty of    --

13.     -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --

14.     -- General Public License for more details.                          --

15.     --                                                                   --

16.     -- You should have received a copy of the GNU General Public         --

17.     -- License along with this library; if not, write to the             --

18.     -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --

19.     -- Boston, MA 02111-1307, USA.                                       --

20.     --                                                                   --

21.     -- As a special exception, if other files instantiate generics from  --

22.     -- this unit, or you link this unit with other files to produce an   --

23.     -- executable, this  unit  does not  by itself cause  the resulting  --

24.     -- executable to be covered by the GNU General Public License. This  --

25.     -- exception does not however invalidate any other reasons why the   --

26.     -- executable file  might be covered by the  GNU Public License.     --

27.     -----------------------------------------------------------------------

29.     --  <description>

30.     --  The Gtk_Color_Button is a button which displays the currently selected

31.     --  color an allows to open a color selection dialog to change the color. It is

32.     --  suitable widget for selecting a color in a preference dialog.

33.     --  </description>

34.     --  <c_version>2.8.17</c_version>

35.     --  <group>Selectors</group>

36.     --  <screenshot>color-button.png</screenshot>

38.     with Glib.PropertiesTo API docTo specTo body;

39.     with Gdk.ColorTo API docTo specTo body;

40.     with Gtk.ButtonTo API docTo specTo body;

42.     package Gtk.Color_ButtonTo API docTo specTo body is

44.        type Gtk_Color_Button_Record is new Gtk.Button.Gtk_Button_RecordTo API docTo spec with

45.          null record;

46.        type Gtk_Color_Button is access all Gtk_Color_Button_RecordTo API docTo spec'Class;

48.        function Get_TypeTo API docTo body return Gtk.Gtk_TypeTo API docTo spec;

49.        --  Return the internal value associated with a Gtk_Color_Button.

51.        procedure Gtk_NewTo API docTo body (Button : out Gtk_Color_ButtonTo API docTo spec);

52.        procedure InitializeTo API docTo body (Button : access Gtk_Color_Button_RecordTo API docTo spec'Class);

53.        --  Creates a new color button. This returns a widget in the form of a small

54.        --  button containing a swatch representing the current selected color. When

55.        --  the button is clicked, a color-selection dialog will open, allowing the

56.        --  user to select a color. The swatch will be updated to reflect the new

57.        --  color when the user finishes.

59.        procedure Gtk_New_With_ColorTo API docTo body

60.          (Button : out Gtk_Color_ButtonTo API docTo spec;

61.           ColorTo API docTo body  : Gdk.Color.Gdk_ColorTo API docTo specTo body);

62.        procedure Initialize_With_ColorTo API docTo body

63.          (Button : access Gtk_Color_Button_RecordTo API docTo spec'Class;

64.           ColorTo API docTo body  : Gdk.Color.Gdk_ColorTo API docTo specTo body);

65.        --  Creates a new color button.

67.        procedure Set_ColorTo API docTo body

68.          (Button : access Gtk_Color_Button_RecordTo API docTo spec;

69.           ColorTo API docTo body  : Gdk.Color.Gdk_ColorTo API docTo specTo body);

70.        function Get_ColorTo API docTo body

71.          (Button : access Gtk_Color_Button_RecordTo API docTo spec) return Gdk.Color.Gdk_ColorTo API docTo specTo body;

72.        --  Sets the current color to be Color.

74.        procedure Set_AlphaTo API docTo body

75.          (Button : access Gtk_Color_Button_RecordTo API docTo spec;

76.           Alpha  : Guint16To API docTo spec);

77.        function Get_AlphaTo API docTo body

78.          (Button : access Gtk_Color_Button_RecordTo API docTo spec)

79.           return Glib.Guint16To API docTo spec;

80.        --  Sets the current opacity to be Alpha (0 to 65_535).

82.        procedure Set_Use_AlphaTo API docTo body

83.          (Button    : access Gtk_Color_Button_RecordTo API docTo spec;

84.           Use_Alpha : Boolean);

85.        function Get_Use_AlphaTo API docTo body

86.          (Button : access Gtk_Color_Button_RecordTo API docTo spec) return Boolean;

87.        --  Sets whether or not the color button should use the alpha channel.

89.        procedure Set_TitleTo API docTo body

90.          (Button : access Gtk_Color_Button_RecordTo API docTo spec;

91.           Title  : String);

92.        function Get_TitleTo API docTo body

93.          (Button : access Gtk_Color_Button_RecordTo API docTo spec) return String;

94.        --  Sets the title for the color selection dialog.

96.        ----------------

97.        -- Properties --

98.        ----------------

100.        --  <properties>

101.        --  The following properties are defined for this widget. See

102.        --  Glib.Properties for more information on properties.

103.        --

104.        --  Name:  Alpha_Property

105.        --  Type:  Uint

106.        --  Descr: The selected opacity value

107.        --         (0 fully transparent, 65535 fully opaque)

108.        --

109.        --  Name:  Color_Property

110.        --  Type:  Boxed

111.        --  Descr: The selected color

112.        --

113.        --  Name:  Title_Property

114.        --  Type:  String

115.        --  Descr: The title of the color selection dialog

116.        --

117.        --  Name:  Use_Alpha_Property

118.        --  Type:  Boolean

119.        --  Descr: Whether or not to give the color an alpha value

120.        --  </properties>

122.        Alpha_Property     : constant Glib.Properties.Property_UintTo API docTo spec;

123.        Color_Property     : constant Gdk.Color.Property_Gdk_ColorTo API docTo spec;

124.        Title_Property     : constant Glib.Properties.Property_StringTo API docTo spec;

125.        Use_Alpha_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

127.        -------------

128.        -- Signals --

129.        -------------

131.        --  <signals>

132.        --  The following new signals are defined for this widget:

133.        --

134.        --  - "color_set"

135.        --    procedure Handler (Button : access Gtk_Color_Button_Record'Class);

136.        --    The color-set signal is emitted when the user selects a color. When

137.        --    handling this signal, use Get_Color and Get_Alpha to find out which

138.        --    color was just selected.

139.        --    Note that this signal is only emitted when the user changes the color.

140.        --    If you need to react to programmatic color changes as well, use the

141.        --    notify::color signal.

142.        --  </signals>

144.        Signal_Color_Set : constant Glib.Signal_NameTo API docTo spec := "color_set";

146.     private

147.        Alpha_PropertyTo API docTo spec : constant Glib.Properties.Property_UintTo API docTo spec :=

148.          Glib.Properties.BuildTo API docTo specTo body ("alpha");

149.        Color_PropertyTo API docTo spec : constant Gdk.Color.Property_Gdk_ColorTo API docTo spec :=

150.          Gdk.Color.Property_Gdk_ColorTo API docTo spec (Glib.BuildTo API docTo specTo body ("color"));

151.        Title_PropertyTo API docTo spec : constant Glib.Properties.Property_StringTo API docTo spec :=

152.          Glib.Properties.BuildTo API docTo specTo body ("title");

153.        Use_Alpha_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

154.          Glib.Properties.BuildTo API docTo specTo body ("use-alpha");

156.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_color_button_get_type");

158.     end Gtk.Color_ButtonTo API docTo specTo body;