## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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

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

3.     --                                                                   --

4.     --                Copyright (C) 2001-2007 AdaCore                    --

5.     --                                                                   --

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

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

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

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

10.     --                                                                   --

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

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

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

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

15.     --                                                                   --

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

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

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

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

20.     --                                                                   --

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

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

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

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

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

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

27.     -----------------------------------------------------------------------

29.     --  <description>

30.     --  This widget displays a view of a Gtk_Text_Buffer. Multiple views can be

31.     --  set on a given buffer.

32.     --  </description>

33.     --  <c_version>2.8.17</c_version>

34.     --  <screenshot>gtk-text_view.png</screenshot>

35.     --  <see>Gtk.Text_Buffer</see>

36.     --  <see>Gtk.Text_Tag</see>

37.     --  <see>Gtk.Text_Attributes</see>

38.     --  <testgtk>create_text_view.adb</testgtk>

39.     --  <group>Multiline Text Editor</group>

41.     with Glib.PropertiesTo API docTo specTo body;

42.     with Gdk.RectangleTo API docTo specTo body;

43.     with Gdk.WindowTo API docTo specTo body;

44.     with Gtk.ContainerTo API docTo specTo body;

45.     with Gtk.EnumsTo API docTo specTo body;

46.     with Gtk.Text_AttributesTo API docTo specTo body;

47.     with Gtk.Text_BufferTo API docTo specTo body;

48.     with Gtk.Text_ChildTo API docTo specTo body;

49.     with Gtk.Text_IterTo API docTo specTo body;

50.     with Gtk.Text_MarkTo API docTo specTo body;

51.     with Gtk.WidgetTo API docTo specTo body;

52.     with Pango.TabsTo API docTo specTo body;

54.     package Gtk.Text_ViewTo API docTo specTo body is

56.        type Gtk_Text_View_RecordTo API docTo body is

57.          new Gtk.Container.Gtk_Container_RecordTo API docTo specTo body with private;

58.        type Gtk_Text_View is access all Gtk_Text_View_RecordTo API docTo specTo body'Class;

60.        procedure Gtk_NewTo API docTo body

61.          (Widget : out Gtk_Text_ViewTo API docTo spec;

62.           Buffer : Gtk.Text_Buffer.Gtk_Text_BufferTo API docTo spec := null);

63.        procedure InitializeTo API docTo body

64.          (Widget : access Gtk_Text_View_RecordTo API docTo specTo body'Class;

65.           Buffer : Gtk.Text_Buffer.Gtk_Text_BufferTo API docTo spec);

66.        --  Creates or initializes a new Gtk_Text_View.

67.        --  If Buffer is null, an empty default buffer will be created for you. Get

68.        --  the buffer with Get_Buffer.

69.        --  Otherwise, create a new text view widget displaying Buffer.

70.        --  One buffer can be shared among many widgets.

71.        --  The text view adds its own reference count to the buffer; it does not

72.        --  take over an existing reference.

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

75.        --  Return the internal value associated with this widget.

77.        procedure Set_BufferTo API docTo body

78.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

79.           Buffer    : access Gtk.Text_Buffer.Gtk_Text_Buffer_RecordTo API docTo specTo body'Class);

80.        --  Set Buffer as the buffer being displayed by Text_View.

81.        --  The previous buffer displayed by the text view is unreferenced, and a

82.        --  reference is added to Buffer. If you owned a reference to Buffer before

83.        --  passing it to this function, you must remove that reference yourself;

84.        --  Gtk_Text_View will not "adopt" it.

86.        function Get_BufferTo API docTo body

87.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body)

88.           return Gtk.Text_Buffer.Gtk_Text_BufferTo API docTo spec;

89.        --  Return the Gtk_Text_Buffer being displayed by this text view.

90.        --  The reference count on the buffer is not incremented; the caller of this

91.        --  function won't own a new reference.

93.        function Scroll_To_IterTo API docTo body

94.          (Text_View     : access Gtk_Text_View_RecordTo API docTo specTo body;

95.           IterTo API docTo body          : Gtk.Text_Iter.Gtk_Text_IterTo API docTo specTo body;

96.           Within_Margin : GdoubleTo API docTo spec;

97.           Use_Align     : Boolean;

98.           Xalign        : GdoubleTo API docTo spec;

99.           Yalign        : GdoubleTo API docTo spec) return Boolean;

100.        --  Scroll Text_View so that Iter is on the screen in the position

101.        --  indicated by Xalign and Yalign. An alignment of 0.0 indicates left or

102.        --  top, 1.0 indicates right or bottom, 0.5 means center. If Use_Align is

103.        --  False, the text scrolls the minimal distance to get the mark onscreen,

104.        --  possibly not scrolling at all. The effective screen for purposes of this

105.        --  function is reduced by a margin of size Within_Margin.

106.        --  Note: This function uses the currently-computed height of the lines in

107.        --  the text buffer. Note that line heights are computed in an idle handler;

108.        --  so this function may not have the desired effect if it's called before

109.        --  the height computations. To avoid oddness, consider using

110.        --  Scroll_To_Mark which saves a point to be scrolled to after line

111.        --  validation.

113.        procedure Scroll_To_MarkTo API docTo body

114.          (Text_View     : access Gtk_Text_View_RecordTo API docTo specTo body;

115.           Mark          : access Gtk.Text_Mark.Gtk_Text_Mark_RecordTo API docTo specTo body'Class;

116.           Within_Margin : GdoubleTo API docTo spec := 0.0;

117.           Use_Align     : Boolean := False;

118.           Xalign        : GdoubleTo API docTo spec := 0.0;

119.           Yalign        : GdoubleTo API docTo spec := 0.0);

120.        --  Scroll Text_View so that Mark is on the screen in the position indicated

121.        --  by Xalign and Yalign. An alignment of 0.0 indicates left or top, 1.0

122.        --  indicates right or bottom, 0.5 means center. If Use_Align is False, the

123.        --  text scrolls the minimal distance to get the mark onscreen, possibly not

124.        --  scrolling at all. The effective screen for purposes of this function is

125.        --  reduced by a margin of size Within_Margin.

127.        procedure Scroll_Mark_OnscreenTo API docTo body

128.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

129.           Mark      : access Gtk.Text_Mark.Gtk_Text_Mark_RecordTo API docTo specTo body'Class);

130.        --  Same as the above with the default values

132.        function Move_Mark_OnscreenTo API docTo body

133.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

134.           Mark      : access Gtk.Text_Mark.Gtk_Text_Mark_RecordTo API docTo specTo body'Class)

135.           return Boolean;

136.        --  Move a mark within the buffer so that it's located within the

137.        --  currently-visible text area.

138.        --  Return value: True if the mark moved (wasn't already onscreen).

140.        function Place_Cursor_OnscreenTo API docTo body

141.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return Boolean;

142.        --  Move the cursor to the currently visible region of the buffer, if it

143.        --  isn't there already.

144.        --  Return value: True if the cursor had to be moved.

146.        procedure Get_Visible_RectTo API docTo body

147.          (Text_View    : access Gtk_Text_View_RecordTo API docTo specTo body;

148.           Visible_RectTo API docTo body : out Gdk.Rectangle.Gdk_RectangleTo API docTo spec);

149.        --  Fill Visible_Rect with the currently-visible region of the buffer, in

150.        --  buffer coordinates. Convert to window coordinates with

151.        --  Buffer_To_Window_Coords.

153.        procedure Get_Iter_LocationTo API docTo body

154.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

155.           IterTo API docTo body      : Gtk.Text_Iter.Gtk_Text_IterTo API docTo specTo body;

156.           LocationTo API docTo body  : out Gdk.Rectangle.Gdk_RectangleTo API docTo spec);

157.        --  Get a rectangle which roughly contains the character at iter.

158.        --  The rectangle position is in buffer coordinates; use

159.        --  Buffer_To_Window_Coords to convert these coordinates to coordinates for

160.        --  one of the windows in the text view.

162.        procedure Get_Iter_At_LocationTo API docTo body

163.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

164.           IterTo API docTo body      : out Gtk.Text_Iter.Gtk_Text_IterTo API docTo specTo body;

165.           X         : GintTo API docTo spec;

166.           Y         : GintTo API docTo spec);

167.        --  Retrieve the iterator at buffer coordinates X and Y. Buffer coordinates

168.        --  are coordinates for the entire buffer, not just the currently-displayed

169.        --  portion. If you have coordinates from an event, you have to convert

170.        --  those to buffer coordinates with Window_To_Buffer_Coords.

172.        procedure Get_Iter_At_PositionTo API docTo body

173.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

174.           IterTo API docTo body      : out Gtk.Text_Iter.Gtk_Text_IterTo API docTo specTo body;

175.           Trailing  : out GintTo API docTo spec;

176.           X         : GintTo API docTo spec;

177.           Y         : GintTo API docTo spec);

178.        --  Retrieves the iterator pointing to the character at buffer coordinates X

179.        --  and Y. Buffer coordinates are coordinates for the entire buffer, not

180.        --  just the currently-displayed portion. If you have coordinates from an

181.        --  event, you have to convert those to buffer coordinates with

182.        --  Window_To_Buffer_Coords.

183.        --  Note that this is different from Get_Iter_At_Location(),

184.        --  which returns cursor locations, i.e. positions between characters)

185.        --  Trailing is set to indicate where in the grapheme the user clicked. It

186.        --  will be either 0, or the number of characters in the grapheme. 0

187.        --  represents the trailing edge of the grapheme.

189.        procedure Get_Line_YrangeTo API docTo body

190.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

191.           IterTo API docTo body      : Gtk.Text_Iter.Gtk_Text_IterTo API docTo specTo body;

192.           Y         : out GintTo API docTo spec;

193.           Height    : out GintTo API docTo spec);

194.        --  Get the Y coordinate of the top of the line containing Iter,

195.        --  and the Height of the line. The coordinate is a buffer coordinate;

196.        --  convert to window coordinates with Buffer_To_Window_Coords.

198.        procedure Get_Line_At_YTo API docTo body

199.          (Text_View   : access Gtk_Text_View_RecordTo API docTo specTo body;

200.           Target_IterTo API docTo body : out Gtk.Text_Iter.Gtk_Text_IterTo API docTo specTo body;

201.           Y           : GintTo API docTo spec;

202.           Line_Top    : out GintTo API docTo spec);

203.        --  Get the Gtk_Text_Iter at the start of the line containing the

204.        --  coordinate Y. Y is in buffer coordinates, convert from window

205.        --  coordinates with Window_To_Buffer_Coords.

206.        --  Line_Top will be filled with the coordinate of the top edge of the line.

208.        procedure Buffer_To_Window_CoordsTo API docTo body

209.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

210.           WinTo API docTo body       : Gtk.Enums.Gtk_Text_Window_TypeTo API docTo spec;

211.           Buffer_X  : GintTo API docTo spec;

212.           Buffer_Y  : GintTo API docTo spec;

213.           Window_X  : out GintTo API docTo spec;

214.           Window_Y  : out GintTo API docTo spec);

215.        --  Convert coordinate (Buffer_X, Buffer_Y) to coordinates for the window

216.        --  Win, and store the result in (Window_X, Window_Y).

218.        procedure Window_To_Buffer_CoordsTo API docTo body

219.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

220.           WinTo API docTo body       : Gtk.Enums.Gtk_Text_Window_TypeTo API docTo spec;

221.           Window_X  : GintTo API docTo spec;

222.           Window_Y  : GintTo API docTo spec;

223.           Buffer_X  : out GintTo API docTo spec;

224.           Buffer_Y  : out GintTo API docTo spec);

225.        --  Convert coordinates on the window identified by Win to buffer

226.        --  coordinates, storing the result in (Buffer_X, Buffer_Y).

228.        function Get_WindowTo API docTo body

229.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

230.           WinTo API docTo body       : Gtk.Enums.Gtk_Text_Window_TypeTo API docTo spec) return Gdk.Window.Gdk_WindowTo API docTo spec;

231.        --  Retrieve the Gdk_Window corresponding to an area of the text view;

232.        --  possible windows include the overall widget window, child windows on the

233.        --  left, right, top, bottom, and the window that displays the text buffer.

234.        --  Windows are null and nonexistent if their width or height is 0, and are

235.        --  nonexistent before the widget has been realized.

237.        function Get_Window_TypeTo API docTo body

238.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

239.           Window    : Gdk.Window.Gdk_WindowTo API docTo spec) return Gtk.Enums.Gtk_Text_Window_TypeTo API docTo spec;

240.        --  Usually used to find out which window an event corresponds to.

241.        --  If you connect to an event signal on Text_View, this function should be

242.        --  called on Get_Window (Event) to see which window it was.

244.        procedure Set_Border_Window_SizeTo API docTo body

245.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

246.           The_TypeTo API docTo body  : Gtk.Enums.Gtk_Text_Window_TypeTo API docTo spec;

247.           Size      : GintTo API docTo spec);

248.        function Get_Border_Window_SizeTo API docTo body

249.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

250.           The_TypeTo API docTo body  : Gtk.Enums.Gtk_Text_Window_TypeTo API docTo spec) return GintTo API docTo spec;

251.        --  Set the width of Text_Window_Left or Text_Window_Right,

252.        --  or the height of Text_Window_Top or Text_Window_Bottom.

253.        --  Automatically destroy the corresponding window if the size is set to 0,

254.        --  and create the window if the size is set to non-zero.

256.        --  <doc_ignore>

257.        procedure Set_Disable_Scroll_On_FocusTo API docTo body

258.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

259.           Set       : Boolean);

260.        function Get_Disable_Scroll_On_FocusTo API docTo body

261.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return Boolean;

262.        --  Set whether the Text_View should scroll to the cursor when it gets the

263.        --  focus. (This is the default behaviour)

264.        --  This procedure has no effect for gtk+ 2.2.2 or later.

265.        --  </doc_ignore>

267.        ---------------

268.        -- Iterators --

269.        ---------------

270.        --  You can manipulate iterators either through the buffer directly (thus

271.        --  independently of any display properties), or through the property (if

272.        --  you need to reference to what the user is actually seeing on the screen)

274.        procedure Forward_Display_LineTo API docTo body

275.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

276.           IterTo API docTo body      : in out Gtk.Text_Iter.Gtk_Text_IterTo API docTo specTo body;

277.           Result    : out    Boolean);

278.        procedure Forward_Display_Line_EndTo API docTo body

279.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

280.           IterTo API docTo body      : in out Gtk.Text_Iter.Gtk_Text_IterTo API docTo specTo body;

281.           Result    : out    Boolean);

282.        --  Moves the given Iter forward by one display (wrapped) line.  A

283.        --  display line is different from a paragraph. Paragraphs are

284.        --  separated by newlines or other paragraph separator characters.

285.        --  Display lines are created by line-wrapping a paragraph.  If

286.        --  wrapping is turned off, display lines and paragraphs will be the

287.        --  same. Display lines are divided differently for each view, since

288.        --  they depend on the view's width; paragraphs are the same in all

289.        --  views, since they depend on the contents of the Gtk_Text_Buffer.

290.        --  Returns True if Iter was moved and is not on the end iterator.

292.        procedure Backward_Display_LineTo API docTo body

293.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

294.           IterTo API docTo body      : in out Gtk.Text_Iter.Gtk_Text_IterTo API docTo specTo body;

295.           Result    : out    Boolean);

296.        procedure Backward_Display_Line_StartTo API docTo body

297.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

298.           IterTo API docTo body      : in out Gtk.Text_Iter.Gtk_Text_IterTo API docTo specTo body;

299.           Result    : out    Boolean);

300.        --  Moves the given Iter backward by one display (wrapped) line. A display

301.        --  line is different from a paragraph. Paragraphs are separated by newlines

302.        --  or other paragraph separator characters. Display lines are created by

303.        --  line-wrapping a paragraph. If wrapping is turned off, display lines and

304.        --  paragraphs will be the same. Display lines are divided differently for

305.        --  each view, since they depend on the view's width; paragraphs are the

306.        --  same in all views, since they depend on the contents of the

307.        --  Gtk_Text_Buffer.

308.        --  Returns True if Iter was moved and is not on the end iterator

310.        function Starts_Display_LineTo API docTo body

311.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

312.           IterTo API docTo body      : Gtk.Text_Iter.Gtk_Text_IterTo API docTo specTo body) return Boolean;

313.        --  Determines whether Iter is at the start of a display line. See

314.        --  Forward_Display_Line for an explanation of display lines vs. paragraphs.

315.        --  Returns true if Iter begins a wrapped line.

317.        procedure Move_VisuallyTo API docTo body

318.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

319.           IterTo API docTo body      : in out Gtk.Text_Iter.Gtk_Text_IterTo API docTo specTo body;

320.           Count     : GintTo API docTo spec;

321.           Result    : out Boolean);

322.        --  Move the iterator a given number of characters visually, treating it as

323.        --  the strong cursor position. If Count is positive, then the new strong

324.        --  cursor position will be Count positions to the right of the old cursor

325.        --  position. If Count is negative then the new strong cursor position will

326.        --  be Count positions to the left of the old cursor position.

327.        --

328.        --  In the presence of bidirection text, the correspondence between logical

329.        --  and visual order will depend on the direction of the current run, and

330.        --  there may be jumps when the cursor is moved off of the end of a run.

331.        --

332.        --  Returns True if Iter moved and is not on the end iterator

334.        ----------------------

335.        -- Children widgets --

336.        ----------------------

337.        --  Any widget can be put in a text_view, for instance to provide an

338.        --  interactive area.

340.        procedure Add_Child_In_WindowTo API docTo body

341.          (Text_View    : access Gtk_Text_View_RecordTo API docTo specTo body;

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

343.           Which_WindowTo API docTo body : Gtk.Enums.Gtk_Text_Window_TypeTo API docTo spec;

344.           Xpos         : GintTo API docTo spec;

345.           Ypos         : GintTo API docTo spec);

346.        --  Adds a child at fixed coordinates in one of the text widget's windows.

347.        --  The window must have nonzero size (see Set_Border_Window_Size). Note

348.        --  that the child coordinates are given relative to the Gdk_Window in

349.        --  question, and that these coordinates have no sane relationship to

350.        --  scrolling. When placing a child in GTK_TEXT_WINDOW_WIDGET, scrolling is

351.        --  irrelevant, the child floats above all scrollable areas. But when

352.        --  placing a child in one of the scrollable windows (border windows or text

353.        --  window), you'll need to compute the child's correct position in buffer

354.        --  coordinates any time scrolling occurs or buffer changes occur, and then

355.        --  call Move_Child() to update the child's position. Unfortunately there's

356.        --  no good way to detect that scrolling has occurred, using the current

357.        --  API; a possible hack would be to update all child positions when the

358.        --  scroll adjustments change or the text buffer changes.

360.        procedure Add_Child_At_AnchorTo API docTo body

361.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

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

363.           Anchor    : access Gtk.Text_Child.Gtk_Text_Child_Anchor_RecordTo API docTo specTo body'Class);

364.        --  Adds a child widget in the text buffer, at the given Anchor.

366.        procedure Move_ChildTo API docTo body

367.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

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

369.           Xpos      : GintTo API docTo spec;

370.           Ypos      : GintTo API docTo spec);

371.        --  Updates the position of a child, as for Add_Child_In_Window.

372.        --  Child must already have been added to the text_view.

374.        ----------------

375.        -- Attributes --

376.        ----------------

378.        function Get_Default_AttributesTo API docTo body

379.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body)

380.           return Gtk.Text_Attributes.Gtk_Text_AttributesTo API docTo spec;

381.        --  Obtains a copy of the default text attributes. These are the attributes

382.        --  used for text unless a tag overrides them. You'd typically pass the

383.        --  default attributes in to Gtk.Text_Iter.Get_Attributes in order to get

384.        --  the attributes in effect at a given text position.

385.        --  The returned value is a copy and should be freed by the caller.

387.        procedure Set_Cursor_VisibleTo API docTo body

388.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

389.           Setting   : Boolean := True);

390.        function Get_Cursor_VisibleTo API docTo body

391.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return Boolean;

392.        --  Toggle whether the insertion point is displayed.

393.        --  A buffer with no editable text probably shouldn't have a visible cursor,

394.        --  so you may want to turn the cursor off.

396.        procedure Set_Wrap_ModeTo API docTo body

397.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

398.           Wrap_ModeTo API docTo body : Gtk.Enums.Gtk_Wrap_ModeTo API docTo spec);

399.        function Get_Wrap_ModeTo API docTo body

400.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return Gtk.Enums.Gtk_Wrap_ModeTo API docTo spec;

401.        --  Set the line wrapping for the view.

403.        procedure Set_EditableTo API docTo body

404.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

405.           Setting   : Boolean := True);

406.        function Get_EditableTo API docTo body

407.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return Boolean;

408.        --  Set the default editability of the Gtk_Text_View.

409.        --  You can override this default setting with tags in the buffer, using the

410.        --  "editable" attribute of tags.

412.        procedure Set_Pixels_Above_LinesTo API docTo body

413.          (Text_View          : access Gtk_Text_View_RecordTo API docTo specTo body;

414.           Pixels_Above_Lines : GintTo API docTo spec);

415.        function Get_Pixels_Above_LinesTo API docTo body

416.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return GintTo API docTo spec;

417.        --  Sets the default number of blank pixels above paragraphs in Text_View.

418.        --  Tags in the buffer for Text_View may override the defaults.

420.        procedure Set_Pixels_Below_LinesTo API docTo body

421.          (Text_View          : access Gtk_Text_View_RecordTo API docTo specTo body;

422.           Pixels_Below_Lines : GintTo API docTo spec);

423.        function Get_Pixels_Below_LinesTo API docTo body

424.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return GintTo API docTo spec;

425.        --  Sets the default number of pixels of blank space

426.        --  to put below paragraphs in Text_View. May be overridden

427.        --  by tags applied to Text_View's buffer.

429.        procedure Set_Pixels_Inside_WrapTo API docTo body

430.          (Text_View          : access Gtk_Text_View_RecordTo API docTo specTo body;

431.           Pixels_Inside_Wrap : GintTo API docTo spec);

432.        function Get_Pixels_Inside_WrapTo API docTo body

433.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return GintTo API docTo spec;

434.        --  Sets the default number of pixels of blank space to leave between

435.        --  display/wrapped lines within a paragraph. May be overridden by

436.        --  tags in Text_View's buffer.

438.        procedure Set_JustificationTo API docTo body

439.          (Text_View     : access Gtk_Text_View_RecordTo API docTo specTo body;

440.           JustificationTo API docTo body : Gtk.Enums.Gtk_JustificationTo API docTo spec);

441.        function Get_JustificationTo API docTo body

442.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body)

443.           return Gtk.Enums.Gtk_JustificationTo API docTo spec;

444.        --  Sets the default justification of text in Text_View.

445.        --  Tags in the view's buffer may override the default.

447.        procedure Set_Left_MarginTo API docTo body

448.          (Text_View   : access Gtk_Text_View_RecordTo API docTo specTo body;

449.           Left_Margin : GintTo API docTo spec);

450.        function Get_Left_MarginTo API docTo body

451.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return GintTo API docTo spec;

452.        --  Sets the default left margin for text in Text_View.

453.        --  Tags in the buffer may override the default.

455.        procedure Set_Right_MarginTo API docTo body

456.          (Text_View    : access Gtk_Text_View_RecordTo API docTo specTo body;

457.           Right_Margin : GintTo API docTo spec);

458.        function Get_Right_MarginTo API docTo body

459.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return GintTo API docTo spec;

460.        --  Sets the default right margin for text in the text view.

461.        --  Tags in the buffer may override the default.

463.        procedure Set_IndentTo API docTo body

464.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body; Indent : GintTo API docTo spec);

465.        function Get_IndentTo API docTo body (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return GintTo API docTo spec;

466.        --  Sets the default indentation for paragraphs in Text_View.

467.        --  Tags in the buffer may override the default.

469.        procedure Set_TabsTo API docTo body

470.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body;

471.           Tabs      : Pango.Tabs.Pango_Tab_ArrayTo API docTo spec);

472.        function Get_TabsTo API docTo body

473.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body)

474.           return Pango.Tabs.Pango_Tab_ArrayTo API docTo spec;

475.        --  Sets the default tab stops for paragraphs in Text_View. Tags in the

476.        --  buffer may override the default

477.        --  The returned array will be Null_Tab_Array if "standard" (8-space) tabs

478.        --  are used. Free the return value Pango.Tabs.Free

480.        procedure Set_OverwriteTo API docTo body

481.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body; Overwrite : Boolean);

482.        function Get_OverwriteTo API docTo body

483.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return Boolean;

484.        --  Changes the Text_View overwrite mode.

486.        procedure Set_Accepts_TabTo API docTo body

487.          (Text_View   : access Gtk_Text_View_RecordTo API docTo specTo body;  Accepts_Tab : Boolean);

488.        function Get_Accepts_TabTo API docTo body

489.          (Text_View : access Gtk_Text_View_RecordTo API docTo specTo body) return Boolean;

490.        --  Sets the behavior of the text widget when the Tab key is pressed. If

491.        --  Accepts_Tab is True a tab character is inserted, otherwise the keyboard

492.        --  focus is moved to the next widget in the focus chain.

494.        ----------------

495.        -- Properties --

496.        ----------------

498.        --  <properties>

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

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

501.        --

502.        --  Name:  Accepts_Tab_Property

503.        --  Type:  Boolean

504.        --  Descr: Whether Tab will result in a tab character being entered

505.        --

506.        --  Name:  Buffer_Property

507.        --  Type:  Object

508.        --  Descr: The buffer which is displayed

509.        --

510.        --  Name:  Cursor_Visible_Property

511.        --  Type:  Boolean

512.        --  Descr: If the insertion cursor is shown

513.        --

514.        --  Name:  Editable_Property

515.        --  Type:  Boolean

516.        --  Descr: Whether the text can be modified by the user

517.        --

518.        --  Name:  Indent_Property

519.        --  Type:  Int

520.        --  Descr: Amount to indent the paragraph, in pixels

521.        --

522.        --  Name:  Justification_Property

523.        --  Type:  Enum

524.        --  Descr: Left, right, or center justification

525.        --

526.        --  Name:  Left_Margin_Property

527.        --  Type:  Int

528.        --  Descr: Width of the left margin in pixels

529.        --

530.        --  Name:  Overwrite_Property

531.        --  Type:  Boolean

532.        --  Descr: Whether entered text overwrites existing contents

533.        --

534.        --  Name:  Pixels_Above_Lines_Property

535.        --  Type:  Int

536.        --  Descr: Pixels of blank space above paragraphs

537.        --

538.        --  Name:  Pixels_Below_Lines_Property

539.        --  Type:  Int

540.        --  Descr: Pixels of blank space below paragraphs

541.        --

542.        --  Name:  Pixels_Inside_Wrap_Property

543.        --  Type:  Int

544.        --  Descr: Pixels of blank space between wrapped lines in a paragraph

545.        --

546.        --  Name:  Right_Margin_Property

547.        --  Type:  Int

548.        --  Descr: Width of the right margin in pixels

549.        --

550.        --  Name:  Tabs_Property

551.        --  Type:  Boxed

552.        --  Descr: Custom tabs for this text

553.        --

554.        --  Name:  Wrap_Mode_Property

555.        --  Type:  Enum

556.        --  Descr: Whether to wrap lines never, at word boundaries, or at character

557.        --         boundaries

558.        --

559.        --  </properties>

561.        Accepts_Tab_Property        : constant Glib.Properties.Property_BooleanTo API docTo spec;

562.        Buffer_Property             : constant Glib.Properties.Property_ObjectTo API docTo spec;

563.        Cursor_Visible_Property     : constant Glib.Properties.Property_BooleanTo API docTo spec;

564.        Editable_Property           : constant Glib.Properties.Property_BooleanTo API docTo spec;

565.        Indent_Property             : constant Glib.Properties.Property_IntTo API docTo spec;

566.        Justification_Property      : constant Gtk.Enums.Property_Gtk_JustificationTo API docTo spec;

567.        Left_Margin_Property        : constant Glib.Properties.Property_IntTo API docTo spec;

568.        Overwrite_Property          : constant Glib.Properties.Property_BooleanTo API docTo spec;

569.        Pixels_Above_Lines_Property : constant Glib.Properties.Property_IntTo API docTo spec;

570.        Pixels_Below_Lines_Property : constant Glib.Properties.Property_IntTo API docTo spec;

571.        Pixels_Inside_Wrap_Property : constant Glib.Properties.Property_IntTo API docTo spec;

572.        Right_Margin_Property       : constant Glib.Properties.Property_IntTo API docTo spec;

573.        --  Tabs_Property           : constant Glib.Properties.Property_Boxed;

574.        Wrap_Mode_Property          : constant Gtk.Enums.Property_Gtk_Wrap_ModeTo API docTo spec;

576.        ----------------------

577.        -- Style Properties --

578.        ----------------------

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

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

582.        --  <style_properties>

583.        --  Name:  Error_Underline_Color_Property

584.        --  Type:  Boxed

585.        --  Descr: Color with which to draw error-indication underlines

586.        --  </style_properties>

588.        --  Error_Underline_Color_Property : constant

589.        --    Glib.Properties.Property_Boxed;

591.        -------------

592.        -- Signals --

593.        -------------

595.        --  <signals>

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

597.        --

598.        --  - "set_scroll_adjustments"

599.        --    procedure Handler

600.        --      (Widget      : access Gtk_Text_View_Record'Class;

601.        --       Hadjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class;

602.        --       Vadjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class);

603.        --

604.        --  - "populate_popup"

605.        --    procedure Handler

606.        --      (Widget : access Gtk_Text_View_Record'Class;

607.        --       Menu   : access Gtk.Menu.Gtk_Menu_Record'Class);

608.        --

609.        --  - "move_cursor"

610.        --    procedure Handler

611.        --      (Widget           : access Gtk_Text_View_Record'Class;

612.        --       Step             : Gtk_Movement_Step;

613.        --       Count            : Gint;

614.        --       Extend_Selection : Boolean);

615.        --

616.        --  - "set_anchor"

617.        --    procedure Handler (Widget : access Gtk_Text_View_Record'Class);

618.        --

619.        --  - "insert_at_cursor"

620.        --    procedure Handler

621.        --      (Widget : access Gtk_Text_View_Record'Class; Str : UTF8_String);

622.        --

623.        --  - "delete_from_cursor"

624.        --    procedure Handler

625.        --      (Widget   : access Gtk_Text_View_Record'Class;

626.        --       The_Type : Gtk_Delete_Type;

627.        --       Count    : Gint);

628.        --

629.        --  - "cut_clipboard"

630.        --    procedure Handler (Widget : access Gtk_Text_View_Record'Class);

631.        --

632.        --  - "copy_clipboard"

633.        --    procedure Handler (Widget : access Gtk_Text_View_Record'Class);

634.        --

635.        --  - "paste_clipboard"

636.        --    procedure Handler (Widget : access Gtk_Text_View_Record'Class);

637.        --

638.        --  - "toggle_overwrite"

639.        --    procedure Handler (Widget : access Gtk_Text_View_Record'Class);

640.        --

641.        --  </signals>

643.        Signal_Backspace              : constant Glib.Signal_NameTo API docTo spec :=

644.                                          "backspace";

645.        Signal_Copy_Clipboard         : constant Glib.Signal_NameTo API docTo spec :=

646.                                          "copy_clipboard";

647.        Signal_Cut_Clipboard          : constant Glib.Signal_NameTo API docTo spec :=

648.                                          "cut_clipboard";

649.        Signal_Delete_From_Cursor     : constant Glib.Signal_NameTo API docTo spec :=

650.                                          "delete_from_cursor";

651.        Signal_Insert_At_Cursor       : constant Glib.Signal_NameTo API docTo spec :=

652.                                          "insert_at_cursor";

653.        Signal_Move_Cursor            : constant Glib.Signal_NameTo API docTo spec :=

654.                                          "move_cursor";

655.        Signal_Move_Focus             : constant Glib.Signal_NameTo API docTo spec :=

656.                                          "move_focus";

657.        Signal_Move_Viewport          : constant Glib.Signal_NameTo API docTo spec :=

658.                                          "move_viewport";

659.        Signal_Page_Horizontally      : constant Glib.Signal_NameTo API docTo spec :=

660.                                          "page_horizontally";

661.        Signal_Paste_Clipboard        : constant Glib.Signal_NameTo API docTo spec :=

662.                                          "paste_clipboard";

663.        Signal_Populate_Popup         : constant Glib.Signal_NameTo API docTo spec :=

664.                                          "populate_popup";

665.        Signal_Select_All             : constant Glib.Signal_NameTo API docTo spec :=

666.                                          "select_all";

667.        Signal_Set_Anchor             : constant Glib.Signal_NameTo API docTo spec :=

668.                                          "set_anchor";

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

670.                                          "set_scroll_adjustments";

671.        Signal_Toggle_Overwrite       : constant Glib.Signal_NameTo API docTo spec :=

672.                                          "toggle_overwrite";

674.     private

675.        type Gtk_Text_View_RecordTo API docTo spec is new Gtk.Container.Gtk_Container_RecordTo API docTo specTo body with

676.          null record;

678.        Accepts_Tab_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

679.          Glib.Properties.BuildTo API docTo specTo body ("accepts-tab");

680.        Buffer_PropertyTo API docTo spec : constant Glib.Properties.Property_ObjectTo API docTo spec :=

681.          Glib.Properties.BuildTo API docTo specTo body ("buffer");

682.        Cursor_Visible_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

683.          Glib.Properties.BuildTo API docTo specTo body ("cursor-visible");

684.        Editable_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

685.          Glib.Properties.BuildTo API docTo specTo body ("editable");

686.        Indent_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

687.          Glib.Properties.BuildTo API docTo specTo body ("indent");

688.        Justification_PropertyTo API docTo spec : constant Gtk.Enums.Property_Gtk_JustificationTo API docTo spec :=

689.          Gtk.Enums.BuildTo API docTo specTo body ("justification");

690.        Left_Margin_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

691.          Glib.Properties.BuildTo API docTo specTo body ("left-margin");

692.        Overwrite_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

693.          Glib.Properties.BuildTo API docTo specTo body ("overwrite");

694.        Pixels_Above_Lines_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

695.          Glib.Properties.BuildTo API docTo specTo body ("pixels-above-lines");

696.        Pixels_Below_Lines_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

697.          Glib.Properties.BuildTo API docTo specTo body ("pixels-below-lines");

698.        Pixels_Inside_Wrap_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

699.          Glib.Properties.BuildTo API docTo specTo body ("pixels-inside-wrap");

700.        Right_Margin_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

701.          Glib.Properties.BuildTo API docTo specTo body ("right-margin");

702.     --     Tabs_Property : constant Glib.Properties.Property_Boxed :=

703.     --       Glib.Properties.Build ("tabs");

704.        Wrap_Mode_PropertyTo API docTo spec : constant Gtk.Enums.Property_Gtk_Wrap_ModeTo API docTo spec :=

705.          Gtk.Enums.BuildTo API docTo specTo body ("wrap-mode");

707.     --     Error_Underline_Color_Property : constant Glib.Properties.Property_Boxed

708.     --       := Glib.Properties.Build ("error-underline-color");

710.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_text_view_get_type");

711.     end Gtk.Text_ViewTo API docTo specTo body;

713.     --  No binding: gtk_text_view_new

715.     --  <example>

716.     --  --  The following example creates an empty text view, and puts it in a

717.     --  --  scrolling area so that if more text is added, scrollbars are created

718.     --  --  automatically.

719.     --

720.     --  declare

721.     --     View     : Gtk_Text_View;

722.     --     Buffer   : Gtk_Text_Buffer;

723.     --     Scrolled : Gtk_Scrolled_Window;

724.     --  begin

725.     --     Gtk_New (Scrolled);

726.     --     Set_Policy (Scrolled, Policy_Automatic, Policy_Automatic);

727.     --     Gtk_New (Buffer);

728.     --     Gtk_New (View, Buffer);

729.     --     Add (Scrolled, View);

730.     --  end;

731.     --  </example>