## 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 is an abstract widget designed to support the common

32.     --  functionalities of all widgets for editing text. It provides general

33.     --  services to manipulate an editable widget, a large number of action

34.     --  signals used for key bindings, and several signals that an

35.     --  application can connect to to modify the behavior of a widget.

36.     --  </description>

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

38.     --  <group>Numeric/Text Data Entry</group>

40.     with Gtk.WidgetTo API docTo specTo body;

42.     package Gtk.EditableTo API docTo specTo body is

44.        type Gtk_Editable_RecordTo API docTo body is new Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body with private;

45.        type Gtk_Editable is access all Gtk_Editable_RecordTo API docTo specTo body'Class;

46.        --  Gtk_Editable is now an interface, not an object per se.

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

49.        --  Return the internal value associated with a Gtk_Editable.

51.        procedure Select_RegionTo API docTo body

52.          (Editable : access Gtk_Editable_RecordTo API docTo specTo body;

53.           Start    : GintTo API docTo spec;

54.           The_End  : GintTo API docTo spec := -1);

55.        --  Select the region of text from Start to The_End.

56.        --  The characters that are selected are those characters at positions

57.        --  from Start up to, but not including The_End. If The_End_Pos is

58.        --  negative, then the characters selected will be those characters

59.        --  from Start to the end of the text.

61.        procedure Get_Selection_BoundsTo API docTo body

62.          (Widget    : access Gtk_Editable_RecordTo API docTo specTo body;

63.           Success   : out Boolean;

64.           Start_Pos : out GuintTo API docTo spec;

65.           End_Pos   : out GuintTo API docTo spec);

66.        --  Return the position of the start and end of the current selection.

67.        --  If success is false, Start_Pos and End_Pos are not modified.

69.        procedure Insert_TextTo API docTo body

70.          (Editable : access Gtk_Editable_RecordTo API docTo specTo body;

71.           New_Text : UTF8_StringTo API docTo spec;

72.           Position : in out GintTo API docTo spec);

73.        --  Insert the given string at the given position.

74.        --  Position is set to the new cursor position. If Position is -1, the

75.        --  text is appended at the end.

77.        procedure Delete_TextTo API docTo body

78.          (Editable  : access Gtk_Editable_RecordTo API docTo specTo body;

79.           Start_Pos : GintTo API docTo spec := 0;

80.           End_Pos   : GintTo API docTo spec := -1);

81.        --  Delete the characters from Start_Pos to End_Pos.

82.        --  If End_Pos is negative, the characters are deleted from Start_Pos to the

83.        --  end of the text.

85.        function Get_CharsTo API docTo body

86.          (Editable  : access Gtk_Editable_RecordTo API docTo specTo body;

87.           Start_Pos : GintTo API docTo spec := 0;

88.           End_Pos   : GintTo API docTo spec := -1) return UTF8_StringTo API docTo spec;

89.        --  Get the text from Start_Pos to End_Pos.

90.        --  If End_Pos is negative, the text from Start_Pos to the end is returned.

92.        procedure Cut_ClipboardTo API docTo body (Editable : access Gtk_Editable_RecordTo API docTo specTo body);

93.        --  Copy the characters in the current selection to the clipboard.

94.        --  The selection is then deleted.

96.        procedure Copy_ClipboardTo API docTo body (Editable : access Gtk_Editable_RecordTo API docTo specTo body);

97.        --  Copy the characters in the current selection to the clipboard.

99.        procedure Paste_ClipboardTo API docTo body (Editable : access Gtk_Editable_RecordTo API docTo specTo body);

100.        --  The contents of the clipboard is pasted into the given widget at

101.        --  the current cursor position.

103.        procedure Delete_SelectionTo API docTo body (Editable : access Gtk_Editable_RecordTo API docTo specTo body);

104.        --  Disclaim and delete the current selection.

106.        procedure Set_PositionTo API docTo body

107.          (Editable : access Gtk_Editable_RecordTo API docTo specTo body;

108.           Position : GintTo API docTo spec);

109.        function Get_PositionTo API docTo body (Editable : access Gtk_Editable_RecordTo API docTo specTo body) return GintTo API docTo spec;

110.        --  Change the position of the cursor in the entry.

111.        --  The cursor is displayed before the character with the given

112.        --  index in the widget (the first character has index 0). The

113.        --  value must be less than or equal to the number of characters in the

114.        --  widget. A value of -1 indicates that the position

115.        --  should be set after the last character in the entry.

116.        --  Note that this position is in characters, not in bytes.

118.        procedure Set_EditableTo API docTo body

119.          (Widget   : access Gtk_Editable_RecordTo API docTo specTo body;

120.           Editable : Boolean := True);

121.        function Get_EditableTo API docTo body

122.          (Editable : access Gtk_Editable_RecordTo API docTo specTo body) return Boolean;

123.        --  Set the editable status of the entry.

124.        --  If Editable is False, the user can not modify the contents of the entry.

125.        --  This does not affect the user of the insertion functions above.

127.        ----------------

128.        -- Properties --

129.        ----------------

131.        --  <properties>

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

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

134.        --

135.        --  </properties>

137.        ---------------

138.        --  Signals  --

139.        ---------------

141.        --  <signals>

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

143.        --

144.        --  - "insert_text"

145.        --    procedure Handler (Widget   : access Gtk_Editable_Record'Class;

146.        --                       Text     : in UTF8_String;

147.        --                       Length   : in Gint;

148.        --                       Position : in Gint_Access);

149.        --

150.        --    Emitted when some text is inserted inside the widget by the

151.        --    user. The default handler inserts the text into the widget.

152.        --    By connecting a handler to this signal, and then by stopping

153.        --    the signal with Gtk.Handlers.Emit_Stop_By_Name, it is possible

154.        --    to modify the inserted text, or even prevent it from being

155.        --    inserted.

156.        --    Position.all should be modified by the callback, and indicates

157.        --    the new position of the cursor after the text has been inserted.

158.        --

159.        --  - "delete_text"

160.        --    procedure Handler (Widget    : access Gtk_Editable_Record'Class;

161.        --                       Start_Pos : in Gint;

162.        --                       End_Pos   : in Gint);

163.        --

164.        --    Emitted when some text is deleted by the user. As for the

165.        --    "insert-text" handler, it is possible to override the default

166.        --    behavior by connecting a handler to this signal, and then

167.        --    stopping the signal.

168.        --

169.        --  - "changed"

170.        --    procedure Handler (Widget : access Gtk_Editable_Record'Class);

171.        --

172.        --    Called when the contents of Widget has changed

173.        --  </signals>

175.        Signal_Changed     : constant Glib.Signal_NameTo API docTo spec := "changed";

176.        Signal_Delete_Text : constant Glib.Signal_NameTo API docTo spec := "delete_text";

177.        Signal_Insert_Text : constant Glib.Signal_NameTo API docTo spec := "insert_text";

179.     private

180.        type Gtk_Editable_RecordTo API docTo spec is new Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body

181.          with null record;

182.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_editable_get_type");

183.     end Gtk.EditableTo API docTo specTo body;