## 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-2013, 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.     --  Gtk_Size_Group provides a mechanism for grouping a number of widgets

32.     --  together so they all request the same amount of space. This is typically

33.     --  useful when you want a column of widgets to have the same size, but you

34.     --  can't use a Gtk_Table widget.

35.     --

36.     --  Note that size groups only affect the amount of space requested, not the

37.     --  size that the widgets finally receive. If you want the widgets in a

38.     --  Gtk_Size_Group to actually be the same size, you need to pack them in such

39.     --  a way that they get the size they request and not more. For example, if you

40.     --  are packing your widgets into a table, you would not include the Fill flag.

41.     --

42.     --  </description>

43.     --  <testgtk>create_size_groups.adb</testgtk>

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

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

47.     with Glib.Generic_PropertiesTo API docTo specTo body; use Glib.Generic_PropertiesTo API docTo specTo body;

48.     with Glib.ObjectTo API docTo specTo body;             use Glib.ObjectTo API docTo specTo body;

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

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

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

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

54.     package Gtk.Size_GroupTo API docTo specTo body is

56.        type Gtk_Size_Group_Record is new GObject_RecordTo API docTo specTo body with null record;

57.        type Gtk_Size_Group is access all Gtk_Size_Group_RecordTo API docTo spec'Class;

59.        type Size_Group_Mode is (None, Horizontal, Vertical, Both);

60.        pragma Convention (C, Size_Group_ModeTo API docTo spec);

61.        --  This type indicates how the size of all widgets in the group match:

62.        --  - None: The behavior is the same as if there was no size. Each widget

63.        --          requests its most appropriate size.

64.        --  - Horizontal: All the widgets in the group will have the same width.

65.        --  - Vertical: All the widgets in the group will have the same height

66.        --  - Both: All the widgets in the group will have exactly the same size.

68.        package Size_Group_Mode_Properties is new

69.        Glib.Generic_Properties.Generic_Internal_Discrete_PropertyTo API docTo specTo body

70.          (Size_Group_ModeTo API docTo spec);

71.        type Property_Size_Group_Mode is new Size_Group_Mode_Properties.PropertyTo API docTo spec;

73.        ------------------

74.        -- Constructors --

75.        ------------------

77.        procedure Gtk_NewTo API docTo body

78.           (Size_Group : out Gtk_Size_GroupTo API docTo spec;

79.            ModeTo API docTo body       : Size_Group_ModeTo API docTo spec := Both);

80.        procedure InitializeTo API docTo body

81.           (Size_Group : access Gtk_Size_Group_RecordTo API docTo spec'Class;

82.            ModeTo API docTo body       : Size_Group_ModeTo API docTo spec := Both);

83.        --  Create a new Gtk.Size_Group.Gtk_Size_Group.

84.        --  "mode": the mode for the new size group.

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

87.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_size_group_get_type");

89.        -------------

90.        -- Methods --

91.        -------------

93.        procedure Add_WidgetTo API docTo body

94.           (Size_Group : access Gtk_Size_Group_RecordTo API docTo spec;

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

96.        --  Adds a widget to a Gtk.Size_Group.Gtk_Size_Group. In the future, the

97.        --  requisition of the widget will be determined as the maximum of its

98.        --  requisition and the requisition of the other widgets in the size group.

99.        --  Whether this applies horizontally, vertically, or in both directions

100.        --  depends on the mode of the size group. See Gtk.Size_Group.Set_Mode. When

101.        --  the widget is destroyed or no longer referenced elsewhere, it will be

102.        --  removed from the size group.

103.        --  "widget": the Gtk.Widget.Gtk_Widget to add

105.        function Get_Ignore_HiddenTo API docTo body

106.           (Size_Group : access Gtk_Size_Group_RecordTo API docTo spec) return Boolean;

107.        procedure Set_Ignore_HiddenTo API docTo body

108.           (Size_Group    : access Gtk_Size_Group_RecordTo API docTo spec;

109.            Ignore_Hidden : Boolean);

110.        --  Sets whether unmapped widgets should be ignored when calculating the

111.        --  size.

112.        --  Since: gtk+ 2.8

113.        --  "ignore_hidden": whether unmapped widgets should be ignored when

114.        --  calculating the size

116.        function Get_ModeTo API docTo body

117.           (Size_Group : access Gtk_Size_Group_RecordTo API docTo spec) return Size_Group_ModeTo API docTo spec;

118.        procedure Set_ModeTo API docTo body

119.           (Size_Group : access Gtk_Size_Group_RecordTo API docTo spec;

120.            ModeTo API docTo body       : Size_Group_ModeTo API docTo spec);

121.        --  Sets the Size_Group_Mode of the size group. The mode of the size group

122.        --  determines whether the widgets in the size group should all have the

123.        --  same horizontal requisition (%GTK_SIZE_GROUP_MODE_HORIZONTAL) all have

124.        --  the same vertical requisition (%GTK_SIZE_GROUP_MODE_VERTICAL), or should

125.        --  all have the same requisition in both directions

126.        --  (%GTK_SIZE_GROUP_MODE_BOTH).

127.        --  "mode": the mode to set for the size group.

129.        function Get_WidgetsTo API docTo body

130.           (Size_Group : access Gtk_Size_Group_RecordTo API docTo spec)

131.            return Gtk.Widget.Widget_SList.GSlistTo API docTo specTo body;

132.        --  Returns the list of widgets associated with Size_Group. widgets. The

133.        --  list is owned by GTK+ and should not be modified.

134.        --  Since: gtk+ 2.10

136.        procedure Remove_WidgetTo API docTo body

137.           (Size_Group : access Gtk_Size_Group_RecordTo API docTo spec;

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

139.        --  Removes a widget from a Gtk.Size_Group.Gtk_Size_Group.

140.        --  "widget": the Gtk.Widget.Gtk_Widget to remove

142.        ----------------

143.        -- Interfaces --

144.        ----------------

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

146.        --

147.        --  - "Buildable"

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

150.          (Gtk.Buildable.Gtk_BuildableTo API docTo spec, Gtk_Size_Group_RecordTo API docTo spec, Gtk_Size_GroupTo API docTo spec);

151.        function "+"

152.          (Widget : access Gtk_Size_Group_RecordTo API docTo spec'Class)

153.        return Gtk.Buildable.Gtk_BuildableTo API docTo spec

154.        renames Implements_Buildable.To_InterfaceTo API docTo specTo body;

155.        function "-"

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

157.        return Gtk_Size_GroupTo API docTo spec

158.        renames Implements_Buildable.To_ObjectTo API docTo specTo body;

160.        ----------------

161.        -- Properties --

162.        ----------------

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

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

165.        --

166.        --  Name: Ignore_Hidden_Property

167.        --  Type: Boolean

168.        --  Flags: read-write

169.        --  If True, unmapped widgets are ignored when determining the size of the

170.        --  group.

171.        --

172.        --  Name: Mode_Property

173.        --  Type: Size_Group_Mode

174.        --  Flags: read-write

176.        Ignore_Hidden_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

177.        Mode_Property : constant Gtk.Size_Group.Property_Size_Group_ModeTo API docTo spec;

179.     private

180.        Ignore_Hidden_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

181.          Glib.Properties.BuildTo API docTo specTo body ("ignore-hidden");

182.        Mode_PropertyTo API docTo spec : constant Gtk.Size_Group.Property_Size_Group_ModeTo API docTo spec :=

183.          Gtk.Size_Group.BuildTo API docTo specTo body ("mode");

184.     end Gtk.Size_GroupTo API docTo specTo body;