## 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 Gtk_Paned is a container that organizes its two children either

32.     --  horizontally or vertically. The initial size allocated to the children

33.     --  depends on the size they request. However, the user has the possibility to

34.     --  interactively move a separation bar between the two to enlarge one of the

35.     --  children, while at the same time shrinking the second one. The bar can be

36.     --  moved by clicking with the mouse on a small cursor displayed in the bar,

37.     --  and then dragging the mouse.

38.     --

39.     --  No additional decoration is provided around the children.

40.     --

41.     --  Each child has two parameters, Resize and Shrink.

42.     --

43.     --  If Shrink is True, then the widget can be made smaller than its

44.     --  requisition size by the user. Set this to False if you want to set a

45.     --  minimum size.

46.     --

47.     --  if Resize is True, this means that the child accepts to be resized, and

48.     --  will not require any size. Thus, the size allocated to it will be the total

49.     --  size allocated to the container minus the size requested by the other

50.     --  child. If Resize is False, the child should ask for a specific size, which

51.     --  it will get. The other child will be resized accordingly. If both Child

52.     --  have the same value for Resize (either True or False), then the size

53.     --  allocated to each is a ratio between the size requested by both.

54.     --

55.     --  When you use Set_Position with a parameter other than -1, or the user

56.     --  moves the handle to resize the widgets, the behavior of Resize is canceled.

57.     --

58.     --  </description>

59.     --  <screenshot>gtk-paned</screenshot>

60.     --  <group>Layout container</group>

61.     --  <testgtk>create_paned.adb</testgtk>

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

64.     with Gdk.WindowTo API docTo specTo body;      use Gdk.WindowTo API docTo specTo body;

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

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

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

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

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

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

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

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

74.     package Gtk.PanedTo API docTo specTo body is

76.        type Gtk_Paned_Record is new Gtk_Container_RecordTo API docTo specTo body with null record;

77.        type Gtk_Paned is access all Gtk_Paned_RecordTo API docTo spec'Class;

79.        subtype Gtk_Hpaned_Record is Gtk_Paned_RecordTo API docTo spec;

80.        subtype Gtk_Hpaned is Gtk_PanedTo API docTo spec;

82.        subtype Gtk_Vpaned_Record is Gtk_Paned_RecordTo API docTo spec;

83.        subtype Gtk_Vpaned is Gtk_PanedTo API docTo spec;

85.        ------------------

86.        -- Constructors --

87.        ------------------

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

90.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_paned_get_type");

92.        procedure Gtk_New_HpanedTo API docTo body (Paned : out Gtk_HpanedTo API docTo spec);

93.        procedure Initialize_HpanedTo API docTo body (Paned : access Gtk_Hpaned_RecordTo API docTo spec'Class);

94.        --  The children will be displayed next to each other

96.        function Get_Type_HpanedTo API docTo body return Glib.GTypeTo API docTo spec;

97.        pragma Import (C, Get_Type_HpanedTo API docTo spec, "gtk_hpaned_get_type");

99.        procedure Gtk_New_VpanedTo API docTo body (Paned : out Gtk_VpanedTo API docTo spec);

100.        procedure Initialize_VpanedTo API docTo body (Paned : access Gtk_Vpaned_RecordTo API docTo spec'Class);

101.        --  The children will be displayed one on top of the other

103.        function Get_Type_VpanedTo API docTo body return Glib.GTypeTo API docTo spec;

104.        pragma Import (C, Get_Type_VpanedTo API docTo spec, "gtk_vpaned_get_type");

106.        -------------

107.        -- Methods --

108.        -------------

110.        procedure Add1To API docTo body

111.           (Paned : access Gtk_Paned_RecordTo API docTo spec;

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

113.        --  Add the first child of the container. The child will be displayed

114.        --  either in the top or in the left pane, depending on the orientation of

115.        --  the container. This is equivalent to using the Pack1 procedure with its

116.        --  default parameters.

118.        procedure Add2To API docTo body

119.           (Paned : access Gtk_Paned_RecordTo API docTo spec;

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

121.        --  Add the second child of the container. It will be displayed in the

122.        --  bottom or right pane, depending on the container's orientation. This is

123.        --  equivalent to using Pack2 with its default parameters.

125.        procedure Compute_PositionTo API docTo body

126.           (Paned      : access Gtk_Paned_RecordTo API docTo spec;

127.            Allocation : GintTo API docTo spec;

128.            Child1_Req : GintTo API docTo spec;

129.            Child2_Req : GintTo API docTo spec);

131.        function Get_Child1To API docTo body

132.           (Paned : access Gtk_Paned_RecordTo API docTo spec) return Gtk.Widget.Gtk_WidgetTo API docTo spec;

133.        --  Obtains the first child of the paned widget.

134.        --  Since: gtk+ 2.4

136.        function Get_Child2To API docTo body

137.           (Paned : access Gtk_Paned_RecordTo API docTo spec) return Gtk.Widget.Gtk_WidgetTo API docTo spec;

138.        --  Obtains the second child of the paned widget.

139.        --  Since: gtk+ 2.4

141.        function Get_Handle_WindowTo API docTo body

142.           (Paned : access Gtk_Paned_RecordTo API docTo spec) return Gdk.Window.Gdk_WindowTo API docTo spec;

143.        --  Returns the Gdk.Window.Gdk_Window of the handle. This function is

144.        --  useful when handling button or motion events because it enables the

145.        --  callback to distinguish between the window of the paned, a child and the

146.        --  handle.

147.        --  Since: gtk+ 2.20

149.        function Get_PositionTo API docTo body (Paned : access Gtk_Paned_RecordTo API docTo spec) return GintTo API docTo spec;

150.        procedure Set_PositionTo API docTo body (Paned : access Gtk_Paned_RecordTo API docTo spec; Position : GintTo API docTo spec);

151.        --  Sets the position of the divider between the two panes.

152.        --  "position": pixel position of divider, a negative value means that the

153.        --  position is unset.

155.        procedure Pack1To API docTo body

156.           (Paned  : access Gtk_Paned_RecordTo API docTo spec;

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

158.            Resize : Boolean := False;

159.            Shrink : Boolean := True);

160.        --  Add a child to the top or left pane. You can not change dynamically the

161.        --  attributes Resize and Shrink. Instead, you have to remove the child from

162.        --  the container, and put it back with the new value of the attributes. You

163.        --  should also first call Glib.Object.Ref on the child so as to be sure it

164.        --  is not destroyed when you remove it, and Glib.Object.Unref it at the

165.        --  end. See the example in testgtk/ in the GtkAda distribution.

167.        procedure Pack2To API docTo body

168.           (Paned  : access Gtk_Paned_RecordTo API docTo spec;

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

170.            Resize : Boolean := False;

171.            Shrink : Boolean := False);

173.        ---------------------

174.        -- Interfaces_Impl --

175.        ---------------------

177.        function Get_OrientationTo API docTo body

178.           (Self : access Gtk_Paned_RecordTo API docTo spec) return Gtk.Enums.Gtk_OrientationTo API docTo spec;

179.        procedure Set_OrientationTo API docTo body

180.           (Self        : access Gtk_Paned_RecordTo API docTo spec;

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

183.        ----------------

184.        -- Interfaces --

185.        ----------------

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

187.        --

188.        --  - "Buildable"

189.        --

190.        --  - "Orientable"

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

193.          (Gtk.Buildable.Gtk_BuildableTo API docTo spec, Gtk_Paned_RecordTo API docTo spec, Gtk_PanedTo API docTo spec);

194.        function "+"

195.          (Widget : access Gtk_Paned_RecordTo API docTo spec'Class)

196.        return Gtk.Buildable.Gtk_BuildableTo API docTo spec

197.        renames Implements_Buildable.To_InterfaceTo API docTo specTo body;

198.        function "-"

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

200.        return Gtk_PanedTo API docTo spec

201.        renames Implements_Buildable.To_ObjectTo API docTo specTo body;

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

204.          (Gtk.Orientable.Gtk_OrientableTo API docTo spec, Gtk_Paned_RecordTo API docTo spec, Gtk_PanedTo API docTo spec);

205.        function "+"

206.          (Widget : access Gtk_Paned_RecordTo API docTo spec'Class)

207.        return Gtk.Orientable.Gtk_OrientableTo API docTo spec

208.        renames Implements_Orientable.To_InterfaceTo API docTo specTo body;

209.        function "-"

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

211.        return Gtk_PanedTo API docTo spec

212.        renames Implements_Orientable.To_ObjectTo API docTo specTo body;

214.        ----------------

215.        -- Properties --

216.        ----------------

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

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

219.        --

220.        --  Name: Max_Position_Property

221.        --  Type: Gint

222.        --  Flags: read-write

223.        --  The largest possible value for the position property. This property is

224.        --  derived from the size and shrinkability of the widget's children.

225.        --

226.        --  Name: Min_Position_Property

227.        --  Type: Gint

228.        --  Flags: read-write

229.        --  The smallest possible value for the position property. This property is

230.        --  derived from the size and shrinkability of the widget's children.

231.        --

232.        --  Name: Position_Property

233.        --  Type: Gint

234.        --  Flags: read-write

235.        --

236.        --  Name: Position_Set_Property

237.        --  Type: Boolean

238.        --  Flags: read-write

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

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

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

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

244.        Max_Position_Property : constant Glib.Properties.Property_IntTo API docTo spec;

245.        Min_Position_Property : constant Glib.Properties.Property_IntTo API docTo spec;

246.        Position_Property : constant Glib.Properties.Property_IntTo API docTo spec;

247.        Position_Set_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

249.        -------------

250.        -- Signals --

251.        -------------

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

253.        --

254.        --  "accept-position"

255.        --     function Handler

256.        --       (Self : access Gtk_Paned_Record'Class) return Boolean;

257.        --  The ::accept-position signal is a <link

258.        --  linkend="keybinding-signals">keybinding signal</link> which gets emitted

259.        --  to accept the current position of the handle when moving it using key

260.        --  bindings. The default binding for this signal is Return or Space.

261.        --

262.        --  "cancel-position"

263.        --     function Handler

264.        --       (Self : access Gtk_Paned_Record'Class) return Boolean;

265.        --  The ::cancel-position signal is a <link

266.        --  linkend="keybinding-signals">keybinding signal</link> which gets emitted

267.        --  to cancel moving the position of the handle using key bindings. The

268.        --  position of the handle will be reset to the value prior to moving it.

269.        --  The default binding for this signal is Escape.

270.        --

271.        --  "cycle-child-focus"

272.        --     function Handler

273.        --       (Self     : access Gtk_Paned_Record'Class;

274.        --        Reversed : Boolean) return Boolean;

275.        --    --  "reversed": whether cycling backward or forward

276.        --  The ::cycle-child-focus signal is a <link

277.        --  linkend="keybinding-signals">keybinding signal</link> which gets emitted

278.        --  to cycle the focus between the children of the paned. The default

279.        --  binding is f6.

280.        --

281.        --  "cycle-handle-focus"

282.        --     function Handler

283.        --       (Self     : access Gtk_Paned_Record'Class;

284.        --        Reversed : Boolean) return Boolean;

285.        --    --  "reversed": whether cycling backward or forward

286.        --  The ::cycle-handle-focus signal is a <link

287.        --  linkend="keybinding-signals">keybinding signal</link> which gets emitted

288.        --  to cycle whether the paned should grab focus to allow the user to change

289.        --  position of the handle by using key bindings. The default binding for

290.        --  this signal is f8.

291.        --

292.        --  "move-handle"

293.        --     function Handler

294.        --       (Self        : access Gtk_Paned_Record'Class;

295.        --        Scroll_Type : Gtk.Enums.Gtk_Scroll_Type) return Boolean;

296.        --    --  "scroll_type": a Gtk.Enums.Gtk_Scroll_Type

297.        --  The ::move-handle signal is a <link

298.        --  linkend="keybinding-signals">keybinding signal</link> which gets emitted

299.        --  to move the handle when the user is using key bindings to move it.

300.        --

301.        --  "toggle-handle-focus"

302.        --     function Handler

303.        --       (Self : access Gtk_Paned_Record'Class) return Boolean;

304.        --  The ::toggle-handle-focus is a <link

305.        --  linkend="keybinding-signals">keybinding signal</link> which gets emitted

306.        --  to accept the current position of the handle and then move focus to the

307.        --  next widget in the focus chain. The default binding is Tab.

309.        Signal_Accept_Position : constant Glib.Signal_NameTo API docTo spec := "accept-position";

310.        Signal_Cancel_Position : constant Glib.Signal_NameTo API docTo spec := "cancel-position";

311.        Signal_Cycle_Child_Focus : constant Glib.Signal_NameTo API docTo spec := "cycle-child-focus";

312.        Signal_Cycle_Handle_Focus : constant Glib.Signal_NameTo API docTo spec := "cycle-handle-focus";

313.        Signal_Move_Handle : constant Glib.Signal_NameTo API docTo spec := "move-handle";

314.        Signal_Toggle_Handle_Focus : constant Glib.Signal_NameTo API docTo spec := "toggle-handle-focus";

316.     private

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

318.          Glib.Properties.BuildTo API docTo specTo body ("max-position");

319.        Min_Position_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

320.          Glib.Properties.BuildTo API docTo specTo body ("min-position");

321.        Position_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

322.          Glib.Properties.BuildTo API docTo specTo body ("position");

323.        Position_Set_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

324.          Glib.Properties.BuildTo API docTo specTo body ("position-set");

325.     end Gtk.PanedTo API docTo specTo body;