## 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-2007 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.     --  This widget displays any given text that can be manipulated by

32.     --  both the user and the programmer.

33.     --  The text can optionally be interactively modified by the user.

34.     --  Different colors and fonts can be used for any given part of the

35.     --  text. The background can have any color, or even be a pixmap.

36.     --  </description>

37.     --  <c_version>2.8.17</c_version>

38.     --  <group>Obsolescent widgets</group>

40.     with Glib.PropertiesTo API docTo specTo body;

41.     with Gdk.ColorTo API docTo specTo body;

42.     with Gdk.FontTo API docTo specTo body;

43.     with Gtk.AdjustmentTo API docTo specTo body;

44.     pragma Warnings (Off);

45.     with Gtk.Old_EditableTo API docTo specTo body;

46.     pragma Warnings (On);

47.     with Gdk.WindowTo API docTo specTo body;

49.     package Gtk.TextTo API docTo specTo body is

50.        pragma Obsolescent;

52.        type Gtk_Text_RecordTo API docTo body is new

53.          Gtk.Old_Editable.Gtk_Old_Editable_RecordTo API docTo specTo body with private;

54.        type Gtk_Text is access all Gtk_Text_RecordTo API docTo specTo body'Class;

56.        procedure Gtk_NewTo API docTo body

57.          (Text : out Gtk_TextTo API docTo spec;

58.           Hadj : in Adjustment.Gtk_AdjustmentTo API docTo spec := null;

59.           Vadj : in Adjustment.Gtk_AdjustmentTo API docTo spec := null);

60.        --  Create a new text widget with the given adjustments.

61.        --  If either or both scrollbars is not provided, the text widget will

62.        --  create its own.

63.        --  You need to insert the Gtk_Text in a Gtk_Scrolled_Window to make

64.        --  the scrollbars visible. Not also that this widget does not currently

65.        --  support horizontal scrollbars.

67.        procedure InitializeTo API docTo body

68.          (Text : access Gtk_Text_RecordTo API docTo specTo body'Class;

69.           Hadj : in Adjustment.Gtk_AdjustmentTo API docTo spec := null;

70.           Vadj : in Adjustment.Gtk_AdjustmentTo API docTo spec := null);

71.        --  Internal initialization function.

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

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

75.        --  Return the internal value associated with a Gtk_Text.

77.        function Get_Text_AreaTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body)

78.          return Gdk.Window.Gdk_WindowTo API docTo spec;

79.        --  Return the specific window into which the text is displayed.

80.        --  Note that a Gtk_Text is in fact a complex widget, which includes borders

81.        --  on the sides. Thus, whenever you want to convert the mouse coordinates

82.        --  to a position in the text, you should use the Gdk.Window.Get_Pointer

83.        --  function, passing it this text area as the origin window, rather than

84.        --  directly Get_Window (Text).

85.        --  Note that null will be returned while Text hasn't been realized.

87.        function Backward_DeleteTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body;

88.                                  Nchars : in GuintTo API docTo spec)

89.                                 return Boolean;

90.        --  Backward delete Nchars characters from the current cursor position.

91.        --  There must be at least Nchars characters to delete before the

92.        --  pointer, or the operation will not be performed.

93.        --  Return True if the operation was successful, False otherwise.

95.        function Forward_DeleteTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body;

96.                                 Nchars : in GuintTo API docTo spec)

97.                                return Boolean;

98.        --  Forward delete Nchars characters from the current point position.

99.        --  There must be at least Nchars characters to delete after the

100.        --  pointer, or the operation will not be performed.

101.        --  Return True if the operation was successful, False otherwise.

103.        procedure FreezeTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body);

104.        --  Freeze the Gtk_Text widget.

105.        --  In other words, stop any redrawing of the widget until the Thaw

106.        --  operation is called. This operation is useful when

107.        --  a large number of changes need to be made within the widget.

108.        --  Freezing it during the updates will avoid some flicker seen by

109.        --  the user.

110.        --  Note also that an internal counter is incremented. The updates will

111.        --  be performed only when the same numbers of calls to Thaw has been

112.        --  performed.

113.        --

114.        --  Note that you can not call Set_Position while the widget is frozen.

115.        --  This will create a Storage_Error otherwise.

117.        procedure ThawTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body);

118.        --  Cancel the previous call to Freeze.

119.        --  Allow the widget to be redrawn again, when Thaw has been called as

120.        --  many times as Freeze.

122.        --  <doc_ignore>

123.        function Get_Gap_PositionTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body) return GuintTo API docTo spec;

124.        function Get_Gap_SizeTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body) return GuintTo API docTo spec;

125.        function Get_Text_EndTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body) return GuintTo API docTo spec;

126.        --  Those 2 functions should probably be deleted.

127.        --  </doc_ignore>

129.        function Get_HadjTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body)

130.                          return Gtk.Adjustment.Gtk_AdjustmentTo API docTo spec;

131.        --  Return the horizontal scrollbar associated with Text.

133.        function Get_VadjTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body)

134.                          return Gtk.Adjustment.Gtk_AdjustmentTo API docTo spec;

135.        --  Return the vertical scrollbar associated to the given text widget.

137.        function Get_LengthTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body) return GuintTo API docTo spec;

138.        --  Return the total length of the text contained within the text widget.

140.        function Get_PointTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body) return GuintTo API docTo spec;

141.        --  Get the current position of the insertion point (cursor).

142.        --  Return the number of characters from the upper left corner of the

143.        --  widget.

145.        procedure Set_PointTo API docTo body (Text  : access Gtk_Text_RecordTo API docTo specTo body;

146.                             Index : in GuintTo API docTo spec);

147.        --  Set the insertion point position.

148.        --  This does not modify the position of the visible cursor (see

149.        --  Gtk.Editable.Set_Position instead).

151.        --  <doc_ignore>

152.        function Get_TextTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body) return UTF8_StringTo API docTo spec;

153.        --  Should probably be deleted (does not work, fails to capture

154.        --  user changes). Use Gtk.Editable.Get_Chars instead.

155.        --  </doc_ignore>

157.        procedure InsertTo API docTo body

158.          (Text   : access Gtk_Text_RecordTo API docTo specTo body;

159.           Font   : in Gdk.Font.Gdk_FontTo API docTo spec := Gdk.Font.Null_FontTo API docTo spec;

160.           ForeTo API docTo body   : in Gdk.Color.Gdk_ColorTo API docTo specTo body := Gdk.Color.Null_ColorTo API docTo specTo body;

161.           BackTo API docTo body   : in Gdk.Color.Gdk_ColorTo API docTo specTo body := Gdk.Color.Null_ColorTo API docTo specTo body;

162.           Chars  : in UTF8_StringTo API docTo spec := "";

163.           Length : in GintTo API docTo spec := -1);

164.        --  Insert the given string (Chars) inside the text of the text widget.

165.        --  Use the specified Font, foreground (Fore) and background

166.        --  (Back) colors. Only the first "Length" characters are inserted,

167.        --  unless Length is set to -1, in which case the complete string is

168.        --  inserted.

169.        --  Note that the colors must be allocated first, and the font loaded.

170.        --  If the default parameters are passed for font and colors, the text

171.        --  widget will use the ones defined in the style for Text (see Gtk.Style

172.        --  for more information about styles).

174.        procedure Set_AdjustmentsTo API docTo body (Text : access Gtk_Text_RecordTo API docTo specTo body;

175.                                   Hadj : Gtk.Adjustment.Gtk_AdjustmentTo API docTo spec;

176.                                   Vadj : Gtk.Adjustment.Gtk_AdjustmentTo API docTo spec);

177.        --  Set the horizontal and vertical adjustments associated with Text.

179.        procedure Set_EditableTo API docTo body (Text     : access Gtk_Text_RecordTo API docTo specTo body;

180.                                Editable : in Boolean := True);

181.        --  Toggle the editable state of the given text widget.

182.        --  This determines whether the user can edit the text or not. Note that

183.        --  the programmer can still perform any update.

185.        procedure Set_Line_WrapTo API docTo body (Text      : access Gtk_Text_RecordTo API docTo specTo body;

186.                                 Line_Wrap : in Boolean := True);

187.        --  Set the Line_Wrap state of the given text widget.

188.        --  If set to True, the line is broken when it reaches the extent of the

189.        --  widget viewing area and the rest is displayed on the next line. If set

190.        --  to false, the line continues regardless of the size of current

191.        --  viewing area.

193.        procedure Set_Word_WrapTo API docTo body (Text      : access Gtk_Text_RecordTo API docTo specTo body;

194.                                 Word_Wrap : in Boolean := True);

195.        --  Set the Word_Wrap state of the given text widget.

196.        --  If set to True, words are wrapped down to the next line if they can't

197.        --  be completed on the current line.

199.        -------------

200.        -- Signals --

201.        -------------

203.        --  <signals>

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

205.        --

206.        --  </signals>

208.        Signal_Set_Scroll_Adjustments : constant Glib.Signal_NameTo API docTo spec :=

209.                                          "set_scroll_adjustments";

211.        ----------------

212.        -- Properties --

213.        ----------------

215.        --  <properties>

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

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

218.        --

219.        --  Name:  Hadjustment_Property

220.        --  Type:  Object

221.        --  Descr: Horizontal adjustment for the text widget

222.        --

223.        --  Name:  Line_Wrap_Property

224.        --  Type:  Boolean

225.        --  Descr: Whether lines are wrapped at widget edges

226.        --

227.        --  Name:  Vadjustment_Property

228.        --  Type:  Object

229.        --  Descr: Vertical adjustment for the text widget

230.        --

231.        --  Name:  Word_Wrap_Property

232.        --  Type:  Boolean

233.        --  Descr: Whether words are wrapped at widget edges

234.        --

235.        --  </properties>

237.        Line_Wrap_Property   : constant Glib.Properties.Property_BooleanTo API docTo spec;

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

239.        Word_Wrap_Property   : constant Glib.Properties.Property_BooleanTo API docTo spec;

241.     private

242.        type Gtk_Text_RecordTo API docTo spec is new Gtk.Old_Editable.Gtk_Old_Editable_RecordTo API docTo specTo body

243.          with null record;

245.        Hadjustment_Property : constant Glib.Properties.Property_ObjectTo API docTo spec :=

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

247.        Line_Wrap_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

248.          Glib.Properties.BuildTo API docTo specTo body ("line-wrap");

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

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

251.        Word_Wrap_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

252.          Glib.Properties.BuildTo API docTo specTo body ("word-wrap");

254.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_text_get_type");

255.     end Gtk.TextTo API docTo specTo body;