## 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.     --  This package defines a special kind of Gtk.Toolbar child that embeds a

31.     --  button.

32.     --  See also gtk-toggle_tool_button.ads, gtk-radio_tool_button.ads and

33.     --  gtk-menu_tool_button.ads

34.     --  </description>

35.     --  <c_version>2.8.17</c_version>

36.     --  <group>Menus and Toolbars</group>

38.     with Glib.PropertiesTo API docTo specTo body;

39.     with Gtk.Tool_ItemTo API docTo specTo body;

40.     with Gtk.WidgetTo API docTo specTo body;

42.     package Gtk.Tool_ButtonTo API docTo specTo body is

44.        type Gtk_Tool_Button_Record is new Gtk.Tool_Item.Gtk_Tool_Item_RecordTo API docTo spec

45.           with null record;

46.        type Gtk_Tool_Button is access all Gtk_Tool_Button_RecordTo API docTo spec'Class;

48.        ----------------------

49.        -- Creating buttons --

50.        ----------------------

52.        procedure Gtk_NewTo API docTo body

53.          (Button      : out Gtk_Tool_ButtonTo API docTo spec;

54.           Icon_Widget : Gtk.Widget.Gtk_WidgetTo API docTo spec := null;

55.           Label       : String := "");

56.        procedure InitializeTo API docTo body

57.          (Button      : access Gtk_Tool_Button_RecordTo API docTo spec'Class;

58.           Icon_Widget : Gtk.Widget.Gtk_WidgetTo API docTo spec := null;

59.           Label       : String := "");

60.        --  Create or initialize a button, given its icon and label. Any of the

61.        --  parameters can be left unspecified if the button has none of these.

63.        procedure Gtk_New_From_StockTo API docTo body

64.          (Button   : out Gtk_Tool_ButtonTo API docTo spec;

65.           Stock_Id : String);

66.        procedure Initialize_From_StockTo API docTo body

67.          (Button   : access Gtk_Tool_Button_RecordTo API docTo spec'Class;

68.           Stock_Id : String);

69.        --  Create or initialize a button from a stock icon (see gtk-stock.ads)

71.        function Get_TypeTo API docTo body return GTypeTo API docTo spec;

72.        --  Return the internal type used for this widget class

74.        procedure Set_Icon_NameTo API docTo body

75.          (Button    : access Gtk_Tool_Button_RecordTo API docTo spec;

76.           Icon_Name : String);

77.        function Get_Icon_NameTo API docTo body

78.          (Button : access Gtk_Tool_Button_RecordTo API docTo spec)  return String;

79.        --  Sets the icon for the tool button from a named themed icon.

80.        --  See the docs for Gtk.Icon_them for more details.

81.        --  The "icon_name" property only has an effect if not overriden by non-null

82.        --  "label", "icon_widget" or "stock_id" properties

84.        procedure Set_Icon_WidgetTo API docTo body

85.          (Button      : access Gtk_Tool_Button_RecordTo API docTo spec;

86.           Icon_Widget : Gtk.Widget.Gtk_WidgetTo API docTo spec := null);

87.        function Get_Icon_WidgetTo API docTo body

88.          (Button : access Gtk_Tool_Button_RecordTo API docTo spec)

89.           return Gtk.Widget.Gtk_WidgetTo API docTo spec;

90.        --  Sets or gets the widget used as icon on Button.

91.        --  If Icon_Widget is null, the icon used for the button is determined by

92.        --  the "stock_id" property. If the latter is also null, the button has no

93.        --  icon

95.        procedure Set_LabelTo API docTo body

96.          (Button : access Gtk_Tool_Button_RecordTo API docTo spec;

97.           Label  : String);

98.        function Get_LabelTo API docTo body

99.          (Button : access Gtk_Tool_Button_RecordTo API docTo spec) return String;

100.        --  Sets or gets the label used for the button. The "label" property only

101.        --  has an effect if not overridden by a non-null "label_widget" property.

102.        --  If both are null, the label comes from the "stock_id" properties. If

103.        --  also null, the button has no label. Get_Label only returns the value of

104.        --  the "labeL" property.

106.        procedure Set_Label_WidgetTo API docTo body

107.          (Button       : access Gtk_Tool_Button_RecordTo API docTo spec;

108.           Label_Widget : Gtk.Widget.Gtk_WidgetTo API docTo spec := null);

109.        function Get_Label_WidgetTo API docTo body

110.          (Button : access Gtk_Tool_Button_RecordTo API docTo spec)

111.           return Gtk.Widget.Gtk_WidgetTo API docTo spec;

112.        --  Sets Label_Widget as the widget that will be used as the label for the

113.        --  button. If this is null, the "label" property is used as label.

115.        procedure Set_Stock_IdTo API docTo body

116.          (Button   : access Gtk_Tool_Button_RecordTo API docTo spec;

117.           Stock_Id : String);

118.        function Get_Stock_IdTo API docTo body

119.          (Button : access Gtk_Tool_Button_RecordTo API docTo spec) return String;

120.        --  Sets the name of the stock item. This property has no effect if

121.        --  overriden by non-null "label" or "icon_widget" properties.

123.        procedure Set_Use_UnderlineTo API docTo body

124.          (Button        : access Gtk_Tool_Button_RecordTo API docTo spec;

125.           Use_Underline : Boolean := True);

126.        function Get_Use_UnderlineTo API docTo body

127.          (Button : access Gtk_Tool_Button_RecordTo API docTo spec)

128.           return Boolean;

129.        --  If Use_Underline is true, an underline in the label property indicates

130.        --  that the next character should be used a mnemonic accelerator key in the

131.        --  overflow menu of the toolbar. For instance, if the label is "_Open",

132.        --  the item in the overflow menu can be activated with alt-O.

133.        --  Labels shown on tool buttons never have mnemonics on them.

135.        -------------

136.        -- Signals --

137.        -------------

139.        --  <signals>

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

141.        --

142.        --  - "clicked"

143.        --    procedure Handler

144.        --       (Button : access Gtk_Tool_Button_Record'Class);

145.        --    Emitted when the button is clicked with the mouse or activated with

146.        --    the keyboard.

147.        --

148.        --  </signals>

150.        Signal_Clicked : constant Glib.Signal_NameTo API docTo spec := "clicked";

152.        ----------------

153.        -- Properties --

154.        ----------------

156.        --  <properties>

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

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

159.        --

160.        --  Name: Label_Property

161.        --  Type: String

162.        --  See : Set_Label / Get_Label

163.        --

164.        --  Name: Use_Underline_Property

165.        --  Type: Boolean

166.        --  See : Set_Use_Underline / Get_Use_Underline

167.        --

168.        --  Name: Label_Widget_Property

169.        --  Type: Object

170.        --  See : Set_Label_Widget / Get_Label_Widget

171.        --

172.        --  Name: Stock_Id_Property

173.        --  Type: String

174.        --  See : Set_Stock_Id / Get_Stock_Id

175.        --

176.        --  Name: Icon_Name_Property

177.        --  Type: String

178.        --  See : Set_Icon_Name / Get_Icon_Name

179.        --

180.        --  Name: Icon_Widget_Property

181.        --  Type: Object

182.        --  See : Set_Icon_Widget / Get_Icon_Widget

183.        --

184.        --  </properties>

186.        Label_Property         : constant Glib.Properties.Property_StringTo API docTo spec;

187.        Use_Underline_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

188.        Label_Widget_Property  : constant Glib.Properties.Property_ObjectTo API docTo spec;

189.        Stock_Id_Property      : constant Glib.Properties.Property_StringTo API docTo spec;

190.        Icon_Name_Property     : constant Glib.Properties.Property_StringTo API docTo spec;

191.        Icon_Widget_Property   : constant Glib.Properties.Property_ObjectTo API docTo spec;

193.     private

194.        Label_PropertyTo API docTo spec         : constant Glib.Properties.Property_StringTo API docTo spec :=

195.          Glib.Properties.BuildTo API docTo specTo body ("label");

196.        Use_Underline_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

197.          Glib.Properties.BuildTo API docTo specTo body ("use-underline");

198.        Label_Widget_PropertyTo API docTo spec  : constant Glib.Properties.Property_ObjectTo API docTo spec :=

199.          Glib.Properties.BuildTo API docTo specTo body ("label-widget");

200.        Stock_Id_PropertyTo API docTo spec      : constant Glib.Properties.Property_StringTo API docTo spec :=

201.          Glib.Properties.BuildTo API docTo specTo body ("stock-id");

202.        Icon_Name_PropertyTo API docTo spec     : constant Glib.Properties.Property_StringTo API docTo spec :=

203.          Glib.Properties.BuildTo API docTo specTo body ("icon-name");

204.        Icon_Widget_PropertyTo API docTo spec   : constant Glib.Properties.Property_ObjectTo API docTo spec :=

205.          Glib.Properties.BuildTo API docTo specTo body ("icon-widget");

207.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_tool_button_get_type");

208.     end Gtk.Tool_ButtonTo API docTo specTo body;