## 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.     --

32.     --  Gtk_Scrolled_Window is a Gtk_Bin child: it's a container the accepts a

33.     --  single child widget. Gtk_Scrolled_Window adds scrollbars to the child

34.     --  widget.

35.     --

36.     --  The scrolled window can work in two ways. Some widgets have native

37.     --  scrolling support; these widgets have "slots" for Gtk_Adjustment objects.

38.     --  The scrolled window installs Gtk_Adjustment objects in the child window's

39.     --  slots using the "set_scroll_adjustments" signal (Conceptually, these

40.     --  widgets implement a "Scrollable" interface).

41.     --

42.     --  The second way to use the scrolled window is useful with widgets that lack

43.     --  the "set_scroll_adjustments" signal. The Gtk_Viewport widget acts as a

44.     --  proxy, implementing scrollability for child widgets that lack their own

45.     --  scrolling capabilities.

46.     --

47.     --  If a widget has native scrolling abilities, it can be added to the

48.     --  Gtk_Scrolled_Window with Gtk.Container.Add. If a widget does not, you must

49.     --  first add the widget to a Gtk_Viewport, then add the Gtk_Viewport to the

50.     --  scrolled window. The convenience function Add_With_Viewport does exactly

51.     --  this, so you can ignore the presence of the viewport.

52.     --

53.     --  If you want to create your own new widget type that can be inserted

54.     --  directly into a scrolled_window, you need to specify a signal for

55.     --  Set_Scroll_Adjustments in the call to Glib.Object.Initialize_Class_Record.

56.     --

57.     --  </description>

58.     --  <c_version>2.16.6</c_version>

59.     --  <group>Scrolling</group>

60.     --  <testgtk>create_scrolled.adb</testgtk>

61.     --  <screenshot>gtk-scrolled_window</screenshot>

63.     with Glib.PropertiesTo API docTo specTo body;

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

65.     with Gtk.BinTo API docTo specTo body;

66.     with Gtk.EnumsTo API docTo specTo body;

67.     with Gtk.ScrollbarTo API docTo specTo body;

68.     with Gtk.WidgetTo API docTo specTo body;

70.     package Gtk.Scrolled_WindowTo API docTo specTo body is

72.        type Gtk_Scrolled_Window_RecordTo API docTo body is new Bin.Gtk_Bin_RecordTo API docTo spec with private;

73.        type Gtk_Scrolled_Window is access all Gtk_Scrolled_Window_RecordTo API docTo specTo body'Class;

75.        procedure Gtk_NewTo API docTo body

76.          (Scrolled_Window : out Gtk_Scrolled_WindowTo API docTo spec;

77.           Hadjustment     : Gtk_AdjustmentTo API docTo spec := null;

78.           Vadjustment     : Gtk_AdjustmentTo API docTo spec := null);

79.        --  Create a new scrolled window.

80.        --  The two arguments are the scrolled window's horizontal and vertical

81.        --  adjustments; these will be shared with the scrollbars and the child

82.        --  widget to keep the bars in sync with the child. Usually you want to use

83.        --  the default value Null_Adjustment for the adjustments, which will cause

84.        --  the scrolled window to create them for you.

86.        procedure InitializeTo API docTo body

87.          (Scrolled_Window : access Gtk_Scrolled_Window_RecordTo API docTo specTo body'Class;

88.           Hadjustment     : Gtk_AdjustmentTo API docTo spec := null;

89.           Vadjustment     : Gtk_AdjustmentTo API docTo spec := null);

90.        --  Internal initialization function.

91.        --  See the section "Creating your own widgets" in the documentation.

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

94.        --  Return the internal value associated with a Gtk_Scrolled_Window.

96.        procedure Set_HadjustmentTo API docTo body

97.          (Scrolled_Window : access Gtk_Scrolled_Window_RecordTo API docTo specTo body;

98.           Hadjustment     : Gtk_AdjustmentTo API docTo spec);

99.        function Get_HadjustmentTo API docTo body

100.          (Scrolled_Window : access Gtk_Scrolled_Window_RecordTo API docTo specTo body)

101.           return Gtk_AdjustmentTo API docTo spec;

102.        --  Set the Gtk_Adjustment for the horizontal scrollbar.

103.        --  This adjustment is used to connect the horizontal scrollbar to the child

104.        --  widget's horizontal scroll functionality.

106.        procedure Set_VadjustmentTo API docTo body

107.          (Scrolled_Window : access Gtk_Scrolled_Window_RecordTo API docTo specTo body;

108.           Vadjustment     : Gtk_AdjustmentTo API docTo spec);

109.        function Get_VadjustmentTo API docTo body

110.          (Scrolled_Window : access Gtk_Scrolled_Window_RecordTo API docTo specTo body)

111.           return Gtk_AdjustmentTo API docTo spec;

112.        --  Set the Gtk_Adjustment for the vertical scrollbar.

113.        --  This adjustment is used to connect the vertical scrollbar to the child

114.        --  widget's vertical scroll functionality.

116.        function Get_HscrollbarTo API docTo body

117.          (Scrolled_Window : access Gtk_Scrolled_Window_RecordTo API docTo specTo body)

118.           return Gtk.Scrollbar.Gtk_ScrollbarTo API docTo spec;

119.        --  Returns the horizontal scrollbar, or null if it doesn't have one.

121.        function Get_VscrollbarTo API docTo body

122.          (Scrolled_Window : access Gtk_Scrolled_Window_RecordTo API docTo specTo body)

123.           return Gtk.Scrollbar.Gtk_ScrollbarTo API docTo spec;

124.        --  Returns the vertical scrollbar, or null if it doesn't have one.

126.        procedure Set_PolicyTo API docTo body

127.          (Scrolled_Window    : access Gtk_Scrolled_Window_RecordTo API docTo specTo body;

128.           H_Scrollbar_PolicyTo API docTo body : Enums.Gtk_Policy_TypeTo API docTo spec;

129.           V_Scrollbar_PolicyTo API docTo body : Enums.Gtk_Policy_TypeTo API docTo spec);

130.        procedure Get_PolicyTo API docTo body

131.          (Scrolled_Window    : access Gtk_Scrolled_Window_RecordTo API docTo specTo body;

132.           H_Scrollbar_PolicyTo API docTo body : out Enums.Gtk_Policy_TypeTo API docTo spec;

133.           V_Scrollbar_PolicyTo API docTo body : out Enums.Gtk_Policy_TypeTo API docTo spec);

134.        --  Set the scrollbar policy for the horizontal and vertical scrollbars.

135.        --  It determines when the scrollbar should appear; it is a value

136.        --  from the Gtk_Policy_Type enumeration. If Policy_Always, the scrollbar is

137.        --  always present; if Policy_Never, the scrollbar is never present; if

138.        --  Policy_Automatic, the scrollbar is present only if needed (that is, if

139.        --  the slider part of the bar would be smaller than the trough - the

140.        --  display is larger than the page size).

142.        procedure Set_PlacementTo API docTo body

143.          (Scrolled_Window  : access Gtk_Scrolled_Window_RecordTo API docTo specTo body;

144.           Window_PlacementTo API docTo body : Gtk.Enums.Gtk_Corner_TypeTo API docTo spec);

145.        function Get_PlacementTo API docTo body

146.          (Scrolled_Window  : access Gtk_Scrolled_Window_RecordTo API docTo specTo body)

147.           return Gtk.Enums.Gtk_Corner_TypeTo API docTo spec;

148.        --  Determine or return the location of the widget with respect to the

149.        --  scrollbars. The default is Corner_Top_Left.

151.        procedure Unset_PlacementTo API docTo body

152.          (Scrolled_Window : access Gtk_Scrolled_Window_RecordTo API docTo specTo body);

153.        --  Unsets the placement of the contents with respect to the scrollbars

154.        --  for the scrolled window. If no window placement is set for a scrolled

155.        --  window, it obeys the "gtk-scrolled-window-placement" XSETTING.

157.        procedure Set_Shadow_TypeTo API docTo body

158.          (Scrolled_Window : access Gtk_Scrolled_Window_RecordTo API docTo specTo body;

159.           Shadow_TypeTo API docTo body     : Gtk.Enums.Gtk_Shadow_TypeTo API docTo spec);

160.        function Get_Shadow_TypeTo API docTo body

161.          (Scrolled_Window : access Gtk_Scrolled_Window_RecordTo API docTo specTo body)

162.           return Gtk.Enums.Gtk_Shadow_TypeTo API docTo spec;

163.        --  Change the type of shadow drawn around the contents of Scrolled_Window.

165.        procedure Add_With_ViewportTo API docTo body

166.          (Scrolled_Window : access Gtk_Scrolled_Window_RecordTo API docTo specTo body;

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

168.        --  Used to add children without native scrolling capabilities.

169.        --  This is simply a convenience function; it is equivalent to adding the

170.        --  unscrollable child to a viewport, then adding the viewport to the

171.        --  scrolled window. If a child has native scrolling, use Gtk.Container.Add

172.        --  instead of this function.

173.        --

174.        --  The viewport scrolls the child by moving its Gdk_Window, and takes the

175.        --  size of the child to be the size of its toplevel Gdk_Window. This will

176.        --  be very wrong for most widgets that support native scrolling; for

177.        --  example, if you add a Gtk_Clist with a viewport, the whole widget will

178.        --  scroll, including the column headings. Thus Gtk_Clist supports scrolling

179.        --  already, and should not be used with the GtkViewport proxy.

180.        --

181.        --  A widget supports scrolling natively if it contains a valid

182.        --  "set_scroll_adjustments" signal.

184.        ----------------

185.        -- Properties --

186.        ----------------

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

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

190.        --  <properties>

191.        --  Name:  Hadjustment_Property

192.        --  Type:  Object

193.        --  Descr: The GtkAdjustment for the horizontal position

194.        --

195.        --  Name:  Hscrollbar_Policy_Property

196.        --  Type:  Enum

197.        --  Descr: When the horizontal scrollbar is displayed

198.        --

199.        --  Name:  Shadow_Type_Property

200.        --  Type:  Enum

201.        --  Descr: Style of bevel around the contents

202.        --

203.        --  Name:  Vadjustment_Property

204.        --  Type:  Object

205.        --  Descr: The GtkAdjustment for the vertical position

206.        --

207.        --  Name:  Vscrollbar_Policy_Property

208.        --  Type:  Enum

209.        --  Descr: When the vertical scrollbar is displayed

210.        --

211.        --  Name:  Window_Placement_Property

212.        --  Type:  Enum

213.        --  Descr: Where the contents are located with respect to the scrollbars

214.        --

215.        --  Name:  Window_Placement_Set_Property

216.        --  Type:  Boolean

217.        --  Descr: Whether "window-placement" should be used to determine the

218.        --         location of the contents with respect to the scrollbars.

219.        --

220.        --  </properties>

222.        Hadjustment_Property       : constant Glib.Properties.Property_ObjectTo API docTo spec;

223.        Hscrollbar_Policy_Property : constant Gtk.Enums.Property_Gtk_Policy_TypeTo API docTo spec;

224.        Shadow_Type_Property       : constant Gtk.Enums.Property_Gtk_Shadow_TypeTo API docTo spec;

225.        Vadjustment_Property       : constant Glib.Properties.Property_ObjectTo API docTo spec;

226.        Vscrollbar_Policy_Property : constant Gtk.Enums.Property_Gtk_Policy_TypeTo API docTo spec;

227.        Window_Placement_Property  : constant Gtk.Enums.Property_Gtk_Shadow_TypeTo API docTo spec;

228.        Window_Placement_Set_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

230.        ----------------------

231.        -- Style Properties --

232.        ----------------------

233.        --  The following properties can be changed through the gtk theme and

234.        --  configuration files, and retrieved through Gtk.Widget.Style_Get_Property

236.        --  <style_properties>

237.        --  Name:  Scrollbar_Spacing_Property

238.        --  Type:  Int

239.        --  Descr: Number of pixels between the scrollbars and the scrolled window

240.        --

241.        --  Name:  Scrollbars_Within_Bevel_Property

242.        --  Type:  Boolean

243.        --  Descr: Place scrollbars within the scrolled window's bevel

244.        --

245.        --  </style_properties>

247.        Scrollbar_Spacing_Property : constant Glib.Properties.Property_IntTo API docTo spec;

248.        Scrollbars_Within_Bevel_Property :

249.          constant Glib.Properties.Property_BooleanTo API docTo spec;

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

252.        -- Signals --

253.        -------------

255.        --  <signals>

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

257.        --

258.        --  - "scroll_child"

259.        --    procedure Handler

260.        --       (Window     : access Gtk_Scrolled_Window_Record'Class;

261.        --        Typ        : Gtk_Scroll_Type;

262.        --        Horizontal : Gboolean);

263.        --    You should emit this signal to request a scrolling of the child. This

264.        --    signal is almost never needed directly, unless you connect it to a

265.        --    key binding.

266.        --    The boolean is used to further qualify Scroll_Start and Scroll_End,

267.        --    which do not have horizontal and vertical variants.

268.        --

269.        --  - "move_focus_out"

270.        --    procedure Handler

271.        --       (Window     : access Gtk_Scrolled_Window_Record'Class;

272.        --        Direction  : Gtk_Direction_Type);

273.        --    Request that the keyboard focus be moved. You almost never have to

274.        --    emit this signal yourself, unless you are binding it to a key for

275.        --    user interaction. You do not need to connect to this signal

276.        --  </signals>

278.        Signal_Move_Focus_Out : constant Glib.Signal_NameTo API docTo spec := "move_focus_out";

279.        Signal_Scroll_Child   : constant Glib.Signal_NameTo API docTo spec := "scroll_child";

281.     private

282.        type Gtk_Scrolled_Window_RecordTo API docTo spec is new Bin.Gtk_Bin_RecordTo API docTo spec with null record;

284.        Hadjustment_PropertyTo API docTo spec       : constant Glib.Properties.Property_ObjectTo API docTo spec :=

285.          Glib.Properties.BuildTo API docTo specTo body ("hadjustment");

286.        Hscrollbar_Policy_PropertyTo API docTo spec : constant Gtk.Enums.Property_Gtk_Policy_TypeTo API docTo spec :=

287.          Gtk.Enums.BuildTo API docTo specTo body ("hscrollbar-policy");

288.        Shadow_Type_PropertyTo API docTo spec       : constant Gtk.Enums.Property_Gtk_Shadow_TypeTo API docTo spec :=

289.          Gtk.Enums.BuildTo API docTo specTo body ("shadow-type");

290.        Vadjustment_PropertyTo API docTo spec       : constant Glib.Properties.Property_ObjectTo API docTo spec :=

291.          Glib.Properties.BuildTo API docTo specTo body ("vadjustment");

292.        Vscrollbar_Policy_PropertyTo API docTo spec : constant Gtk.Enums.Property_Gtk_Policy_TypeTo API docTo spec :=

293.          Gtk.Enums.BuildTo API docTo specTo body ("vscrollbar-policy");

294.        Window_Placement_PropertyTo API docTo spec  : constant Gtk.Enums.Property_Gtk_Shadow_TypeTo API docTo spec :=

295.          Gtk.Enums.BuildTo API docTo specTo body ("window-placement");

296.        Window_Placement_Set_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

297.          Glib.Properties.BuildTo API docTo specTo body ("window-placement-set");

299.        Scrollbars_Within_Bevel_PropertyTo API docTo spec :

300.          constant Glib.Properties.Property_BooleanTo API docTo spec :=

301.          Glib.Properties.BuildTo API docTo specTo body ("scrollbars-within-bevel");

302.        Scrollbar_Spacing_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

303.          Glib.Properties.BuildTo API docTo specTo body ("scrollbar-spacing");

305.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_scrolled_window_get_type");

306.     end Gtk.Scrolled_WindowTo API docTo specTo body;