## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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

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

3.     --                                                                   --

4.     --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   --

5.     --                Copyright (C) 2000-2011, AdaCore                   --

6.     --                                                                   --

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

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

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

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

11.     --                                                                   --

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

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

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

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

16.     --                                                                   --

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

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

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

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

21.     --                                                                   --

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

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

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

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

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

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

28.     -----------------------------------------------------------------------

30.     --  <description>

31.     --  A box is a container that can have multiple children, organized either

32.     --  horizontally or vertically. Two subtypes are provided, Gtk_Hbox and

33.     --  Gtk_Vbox, to conform to the C API. In Ada, you do not need to distinguish

34.     --  between the two, but note that the Gtk_Box type is conceptually an abstract

35.     --  type: there is no way to create a "Gtk_Box", only ways to create either an

36.     --  horizontal box, or a vertical box.

37.     --

38.     --  Children can be added to one of two positions in the box, either at the

39.     --  beginning (ie left or top) or at the end (ie right or bottom). Each of

40.     --  these positions can contain multiple widgets.

41.     --

42.     --  Every time a child is added to the start, it is placed to the right (resp.

43.     --  the bottom) of the previous widget added to the start.

44.     --

45.     --  Every time a child is added to the end, it is placed to the left (resp.

46.     --  the top) of the previous widget added to the end.

47.     --

48.     --  There are a number of parameters to specify the behavior of the box when

49.     --  it is resized, and how the children should be reorganized and/or resized.

50.     --

51.     --  See the testgtk example in the GtkAda distribution to see concrete

52.     --  examples on how all the parameters for the boxes work.

53.     --

54.     --  </description>

55.     --  <screenshot>gtk-box</screenshot>

56.     --  <group>Layout containers</group>

57.     --  <testgtk>create_box.adb</testgtk>

59.     pragma Warnings (Off, "*is already use-visible*");

60.     with GlibTo API docTo specTo body;            use GlibTo API docTo specTo body;

61.     with Glib.PropertiesTo API docTo specTo body; use Glib.PropertiesTo API docTo specTo body;

62.     with Glib.TypesTo API docTo specTo body;      use Glib.TypesTo API docTo specTo body;

63.     with Gtk.BuildableTo API docTo specTo body;   use Gtk.BuildableTo API docTo specTo body;

64.     with Gtk.ContainerTo API docTo specTo body;   use Gtk.ContainerTo API docTo specTo body;

65.     with Gtk.EnumsTo API docTo specTo body;       use Gtk.EnumsTo API docTo specTo body;

66.     with Gtk.OrientableTo API docTo specTo body;  use Gtk.OrientableTo API docTo specTo body;

67.     with Gtk.WidgetTo API docTo specTo body;      use Gtk.WidgetTo API docTo specTo body;

69.     package Gtk.BoxTo API docTo specTo body is

71.        type Gtk_Box_Record is new Gtk_Container_RecordTo API docTo specTo body with null record;

72.        type Gtk_Box is access all Gtk_Box_RecordTo API docTo spec'Class;

74.        subtype Gtk_Hbox_Record is Gtk_Box_RecordTo API docTo spec;

75.        subtype Gtk_Hbox is Gtk_BoxTo API docTo spec;

77.        subtype Gtk_Vbox_Record is Gtk_Box_RecordTo API docTo spec;

78.        subtype Gtk_Vbox is Gtk_BoxTo API docTo spec;

80.        ------------------

81.        -- Constructors --

82.        ------------------

84.        function Get_TypeTo API docTo body return Glib.GTypeTo API docTo spec;

85.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_box_get_type");

87.        procedure Gtk_New_HboxTo API docTo body

88.           (Box         : out Gtk_HboxTo API docTo spec;

89.            Homogeneous : Boolean := False;

90.            Spacing     : GintTo API docTo spec := 0);

91.        procedure Initialize_HboxTo API docTo body

92.           (Box         : access Gtk_Hbox_RecordTo API docTo spec'Class;

93.            Homogeneous : Boolean := False;

94.            Spacing     : GintTo API docTo spec := 0);

95.        --  Creates a new Gtk.Box.Gtk_Hbox.

96.        --  "homogeneous": True if all children are to be given equal space

97.        --  allotments.

98.        --  "spacing": the number of pixels to place by default between children.

100.        function Get_Hbox_TypeTo API docTo body return Glib.GTypeTo API docTo spec;

101.        pragma Import (C, Get_Hbox_TypeTo API docTo spec, "gtk_hbox_get_type");

103.        procedure Gtk_New_VboxTo API docTo body

104.           (Box         : out Gtk_VboxTo API docTo spec;

105.            Homogeneous : Boolean := False;

106.            Spacing     : GintTo API docTo spec := 0);

107.        procedure Initialize_VboxTo API docTo body

108.           (Box         : access Gtk_Vbox_RecordTo API docTo spec'Class;

109.            Homogeneous : Boolean := False;

110.            Spacing     : GintTo API docTo spec := 0);

111.        --  Creates a new Gtk.Box.Gtk_Vbox.

112.        --  "homogeneous": True if all children are to be given equal space

113.        --  allotments.

114.        --  "spacing": the number of pixels to place by default between children.

116.        function Get_Vbox_TypeTo API docTo body return Glib.GTypeTo API docTo spec;

117.        pragma Import (C, Get_Vbox_TypeTo API docTo spec, "gtk_vbox_get_type");

119.        -------------

120.        -- Methods --

121.        -------------

123.        function Get_HomogeneousTo API docTo body (Box : access Gtk_Box_RecordTo API docTo spec) return Boolean;

124.        procedure Set_HomogeneousTo API docTo body

125.           (Box         : access Gtk_Box_RecordTo API docTo spec;

126.            Homogeneous : Boolean);

127.        --  Sets the Gtk.Box.Gtk_Box:homogeneous property of Box, controlling

128.        --  whether or not all children of Box are given equal space in the box.

129.        --  "homogeneous": a boolean value, True to create equal allotments, False

130.        --  for variable allotments

132.        function Get_SpacingTo API docTo body (Box : access Gtk_Box_RecordTo API docTo spec) return GintTo API docTo spec;

133.        procedure Set_SpacingTo API docTo body (Box : access Gtk_Box_RecordTo API docTo spec; Spacing : GintTo API docTo spec);

134.        --  Sets the Gtk.Box.Gtk_Box:spacing property of Box, which is the number

135.        --  of pixels to place between children of Box.

136.        --  "spacing": the number of pixels to put between children

138.        procedure Pack_EndTo API docTo body

139.           (In_Box  : access Gtk_Box_RecordTo API docTo spec;

140.            Child   : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

141.            Expand  : Boolean := True;

142.            Fill    : Boolean := True;

143.            Padding : GuintTo API docTo spec := 0);

144.        --  Adds Child to Box, packed with reference to the end of Box. The Child

145.        --  is packed after (away from end of) any other child packed with reference

146.        --  to the end of Box.

147.        --  "child": the Gtk.Widget.Gtk_Widget to be added to Box

148.        --  "expand": True if the new child is to be given extra space allocated to

149.        --  Box. The extra space will be divided evenly between all children of Box

150.        --  that use this option

151.        --  "fill": True if space given to Child by the Expand option is actually

152.        --  allocated to Child, rather than just padding it. This parameter has no

153.        --  effect if Expand is set to False. A child is always allocated the full

154.        --  height of a Gtk.Box.Gtk_Hbox and the full width of a Gtk.Box.Gtk_Vbox.

155.        --  This option affects the other dimension

156.        --  "padding": extra space in pixels to put between this child and its

157.        --  neighbors, over and above the global amount specified by

158.        --  Gtk.Box.Gtk_Box:spacing property. If Child is a widget at one of the

159.        --  reference ends of Box, then Padding pixels are also put between

161.        procedure Pack_End_DefaultsTo API docTo body

162.           (Box    : access Gtk_Box_RecordTo API docTo spec;

163.            Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

164.        pragma Obsolescent (Pack_End_DefaultsTo API docTo specTo body);

165.        --  Adds Widget to Box, packed with reference to the end of Box. The child

166.        --  is packed after any other child packed with reference to the start of

167.        --  Box. Parameters for how to pack the child Widget,

168.        --  Gtk.Box.Gtk_Box:expand, Gtk.Box.Gtk_Box:fill and

169.        --  Gtk.Box.Gtk_Box:padding, are given their default values, True, True, and

170.        --  0, respectively.

171.        --  Deprecated since 2.14, Use Gtk.Box.Pack_End

172.        --  "widget": the Gtk.Widget.Gtk_Widget to be added to Box

174.        procedure Pack_StartTo API docTo body

175.           (In_Box  : access Gtk_Box_RecordTo API docTo spec;

176.            Child   : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

177.            Expand  : Boolean := True;

178.            Fill    : Boolean := True;

179.            Padding : GuintTo API docTo spec := 0);

180.        --  Adds Child to Box, packed with reference to the start of Box. The Child

181.        --  is packed after any other child packed with reference to the start of

182.        --  Box.

183.        --  "child": the Gtk.Widget.Gtk_Widget to be added to Box

184.        --  "expand": True if the new child is to be given extra space allocated to

185.        --  "fill": True if space given to Child by the Expand option is actually

186.        --  allocated to Child, rather than just padding it. This parameter has no

187.        --  effect if Expand is set to False. A child is always allocated the full

188.        --  height of a Gtk.Box.Gtk_Hbox and the full width of a Gtk.Box.Gtk_Vbox.

189.        --  This option affects the other dimension

190.        --  "padding": extra space in pixels to put between this child and its

191.        --  neighbors, over and above the global amount specified by

192.        --  Gtk.Box.Gtk_Box:spacing property. If Child is a widget at one of the

193.        --  reference ends of Box, then Padding pixels are also put between

195.        procedure Pack_Start_DefaultsTo API docTo body

196.           (Box    : access Gtk_Box_RecordTo API docTo spec;

197.            Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

198.        pragma Obsolescent (Pack_Start_DefaultsTo API docTo specTo body);

199.        --  Adds Widget to Box, packed with reference to the start of Box. The

200.        --  child is packed after any other child packed with reference to the start

201.        --  of Box. Parameters for how to pack the child Widget,

202.        --  Gtk.Box.Gtk_Box:expand, Gtk.Box.Gtk_Box:fill and

203.        --  Gtk.Box.Gtk_Box:padding, are given their default values, True, True, and

204.        --  0, respectively.

205.        --  Deprecated since 2.14, Use Gtk.Box.Pack_Start

206.        --  "widget": the Gtk.Widget.Gtk_Widget to be added to Box

208.        procedure Query_Child_PackingTo API docTo body

209.           (Box       : access Gtk_Box_RecordTo API docTo spec;

210.            Child     : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

211.            Expand    : out Boolean;

212.            Fill      : out Boolean;

213.            Padding   : out GuintTo API docTo spec;

214.            Pack_TypeTo API docTo body : out Gtk.Enums.Gtk_Pack_TypeTo API docTo spec);

215.        procedure Set_Child_PackingTo API docTo body

216.           (Box       : access Gtk_Box_RecordTo API docTo spec;

217.            Child     : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

218.            Expand    : Boolean;

219.            Fill      : Boolean;

220.            Padding   : GuintTo API docTo spec;

221.            Pack_TypeTo API docTo body : Gtk.Enums.Gtk_Pack_TypeTo API docTo spec);

222.        --  Sets the way Child is packed into Box.

223.        --  "child": the Gtk.Widget.Gtk_Widget of the child to set

224.        --  "expand": the new value of the Gtk.Box.Gtk_Box:expand child property

225.        --  "fill": the new value of the Gtk.Box.Gtk_Box:fill child property

226.        --  "padding": the new value of the Gtk.Box.Gtk_Box:padding child property

227.        --  "pack_type": the new value of the Gtk.Box.Gtk_Box:pack-type child

228.        --  property

230.        procedure Reorder_ChildTo API docTo body

231.           (Box      : access Gtk_Box_RecordTo API docTo spec;

232.            Child    : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

233.            Position : GintTo API docTo spec);

234.        --  Moves Child to a new Position in the list of Box children. The list is

235.        --  the <structfield>children</structfield> field of Gtk.Box.Gtk_Box-struct,

236.        --  and contains both widgets packed GTK_PACK_START as well as widgets

237.        --  packed GTK_PACK_END, in the order that these widgets were added to Box.

238.        --  A widget's position in the Box children list determines where the widget

239.        --  is packed into Box. A child widget at some position in the list will be

240.        --  packed just after all other widgets of the same packing type that appear

241.        --  earlier in the list.

242.        --  "child": the Gtk.Widget.Gtk_Widget to move

243.        --  "position": the new position for Child in the list of children of Box,

244.        --  starting from 0. If negative, indicates the end of the list

246.        function Get_ChildTo API docTo body

247.           (Box : access Gtk_Box_RecordTo API docTo spec;

248.            Num : GintTo API docTo spec) return Gtk.Widget.Gtk_WidgetTo API docTo spec;

249.        --  Return the Num-th child of the box, or null if there is no such child

250.        --  Since: gtk+ GtkAda 1.0

252.        ---------------------

253.        -- Interfaces_Impl --

254.        ---------------------

256.        function Get_OrientationTo API docTo body

257.           (Self : access Gtk_Box_RecordTo API docTo spec) return Gtk.Enums.Gtk_OrientationTo API docTo spec;

258.        procedure Set_OrientationTo API docTo body

259.           (Self        : access Gtk_Box_RecordTo API docTo spec;

260.            OrientationTo API docTo body : Gtk.Enums.Gtk_OrientationTo API docTo spec);

262.        ----------------

263.        -- Interfaces --

264.        ----------------

265.        --  This class implements several interfaces. See Glib.Types

266.        --

267.        --  - "Buildable"

268.        --

269.        --  - "Orientable"

271.        package Implements_Buildable is new Glib.Types.ImplementsTo API docTo specTo body

272.          (Gtk.Buildable.Gtk_BuildableTo API docTo spec, Gtk_Box_RecordTo API docTo spec, Gtk_BoxTo API docTo spec);

273.        function "+"

274.          (Widget : access Gtk_Box_RecordTo API docTo spec'Class)

275.        return Gtk.Buildable.Gtk_BuildableTo API docTo spec

276.        renames Implements_Buildable.To_InterfaceTo API docTo specTo body;

277.        function "-"

278.          (Interf : Gtk.Buildable.Gtk_BuildableTo API docTo spec)

279.        return Gtk_BoxTo API docTo spec

280.        renames Implements_Buildable.To_ObjectTo API docTo specTo body;

282.        package Implements_Orientable is new Glib.Types.ImplementsTo API docTo specTo body

283.          (Gtk.Orientable.Gtk_OrientableTo API docTo spec, Gtk_Box_RecordTo API docTo spec, Gtk_BoxTo API docTo spec);

284.        function "+"

285.          (Widget : access Gtk_Box_RecordTo API docTo spec'Class)

286.        return Gtk.Orientable.Gtk_OrientableTo API docTo spec

287.        renames Implements_Orientable.To_InterfaceTo API docTo specTo body;

288.        function "-"

289.          (Interf : Gtk.Orientable.Gtk_OrientableTo API docTo spec)

290.        return Gtk_BoxTo API docTo spec

291.        renames Implements_Orientable.To_ObjectTo API docTo specTo body;

293.        ----------------

294.        -- Properties --

295.        ----------------

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

297.        --  Glib.Properties for more information on properties)

298.        --

299.        --  Name: Homogeneous_Property

300.        --  Type: Boolean

301.        --  Flags: read-write

302.        --

303.        --  Name: Spacing_Property

304.        --  Type: Gint

305.        --  Flags: read-write

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

307.        --  Glib.Properties for more information on properties)

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

309.        --  Glib.Properties for more information on properties)

311.        Homogeneous_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

312.        Spacing_Property : constant Glib.Properties.Property_IntTo API docTo spec;

314.     private

315.        Homogeneous_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

316.          Glib.Properties.BuildTo API docTo specTo body ("homogeneous");

317.        Spacing_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

318.          Glib.Properties.BuildTo API docTo specTo body ("spacing");

319.     end Gtk.BoxTo API docTo specTo body;