## 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.     --  The Gtk_Tree_Selection object is a helper object to manage the selection

31.     --  for a Gtk_Tree_View widget. The Gtk_Tree_Selection object is automatically

32.     --  created when a new Gtk_Tree_View widget is created, and cannot exist

33.     --  independentally of this widget. The primary reason the Gtk_Tree_Selection

34.     --  objects exists is for cleanliness of code and API. That is, there is no

35.     --  conceptual reason all these functions could not be methods on the

36.     --  Gtk_Tree_View widget instead of separate function.

37.     --

38.     --  The Gtk_Tree_Selection object is gotten from a Gtk_Tree_View by calling

39.     --  Gtk.Tree_View.Get_Selection. It can be manipulated to check the selection

40.     --  status of the tree, as well as select and deselect individual rows.

41.     --  Selection is done completely view side. As a result, multiple views of the

42.     --  same model can have completely different selections. Additionally, you

43.     --  cannot change the selection of a row on the model that is not currently

44.     --  displayed by the view without expanding its parents first.

45.     --

46.     --  One of the important things to remember when monitoring the selection of a

47.     --  view is that the "changed" signal is mostly a hint. That is, it may only

48.     --  emit one signal when a range of rows is selected. Additionally, it may on

49.     --  occasion emit a "changed" signal when nothing has happened (mostly as a

50.     --  result of programmers calling select_row on an already selected row).

51.     --  </description>

52.     --  <c_version>2.8.17</c_version>

53.     --  <group>Trees and Lists</group>

55.     with Glib.ObjectTo API docTo specTo body;

56.     with GtkTo API docTo spec;

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

58.     with Gtk.Tree_ModelTo API docTo specTo body;

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

61.     package Gtk.Tree_SelectionTo API docTo specTo body is

63.        type Gtk_Tree_Selection_RecordTo API docTo body is

64.          new Glib.Object.GObject_RecordTo API docTo specTo body with private;

65.        type Gtk_Tree_Selection is access all Gtk_Tree_Selection_RecordTo API docTo specTo body'Class;

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

68.        --  Return the internal type associated with Gtk_Tree_Selection.

70.        procedure Set_ModeTo API docTo body

71.          (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class;

72.           The_TypeTo API docTo body  : Gtk_Selection_ModeTo API docTo spec);

73.        function Get_ModeTo API docTo body

74.          (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class)

75.           return Gtk_Selection_ModeTo API docTo spec;

76.        --  Set the selection mode of the Selection.

77.        --  If the previous type was Gtk_Selection_Multiple,

78.        --  then the anchor is kept selected, if it was  previously selected.

80.        function Get_Tree_ViewTo API docTo body

81.          (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class)

82.           return Gtk.Widget.Gtk_WidgetTo API docTo spec;

83.        --  Return the tree view associated with Selection.

85.        function Count_Selected_RowsTo API docTo body

86.          (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body) return GintTo API docTo spec;

87.        --  Returns the number of rows that have been selected.

89.        procedure Get_SelectedTo API docTo body

90.          (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class;

91.           Model     : out Gtk.Tree_Model.Gtk_Tree_ModelTo API docTo spec;

92.           IterTo API docTo body      : out Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body);

93.        --  Set Iter to the currently selected node if Selection

94.        --  is set to Gtk_Selection_Single or Gtk_Selection_Browse.

95.        --  Iter is set to Null_Iter if no node is currently selected.

96.        --  Model is filled with the current model as a convenience. This function

97.        --  will not work if Selection is set to Gtk_Selection_Multiple.

99.        procedure Get_Selected_RowsTo API docTo body

100.          (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body;

101.           Model     : out Gtk.Tree_Model.Gtk_Tree_ModelTo API docTo spec;

102.           Path_ListTo API docTo body : out Gtk.Tree_Model.Gtk_Tree_Path_List.GlistTo API docTo specTo body);

103.        --  Creates a list of path of all selected rows. Additionally, if you are

104.        --  planning on modifying the model after calling this function, you may

105.        --  want to convert the returned list into a list of Gtk_Tree_Row_Reference.

106.        --

107.        --  You must free the resulting list by calling Path_Free on each item, and

108.        --  then freeing the list itself.

110.        generic

111.           type Data_Type is private;

112.        package Selection_ForeachTo API docTo body is

114.           type Data_Type_Access is access all Data_TypeTo API docTo spec;

116.           type Foreach_Func is access procedure

117.             (Model : Gtk.Tree_Model.Gtk_Tree_ModelTo API docTo spec;

118.              Path  : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec;

119.              Iter  : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body;

120.              Data  : Data_Type_AccessTo API docTo spec);

122.           procedure Selected_ForeachTo API docTo body

123.             (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class;

124.              Func      : Foreach_FuncTo API docTo spec;

125.              Data      : Data_Type_AccessTo API docTo spec);

126.           --  Call Func for each selected node.

128.        end Selection_ForeachTo API docTo specTo body;

130.        procedure Select_PathTo API docTo body

131.          (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class;

132.           Path      : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec);

133.        procedure Unselect_PathTo API docTo body

134.          (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class;

135.           Path      : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec);

136.        --  Selects or unselects the row at path.

138.        function Path_Is_SelectedTo API docTo body

139.          (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class;

140.           Path      : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec)

141.           return Boolean;

142.        --  Return True if the row pointed to by path is currently selected.

143.        --  If path does not point to a valid location, False is returned

145.        procedure Select_IterTo API docTo body

146.          (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class;

147.           IterTo API docTo body      : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body);

148.        procedure Unselect_IterTo API docTo body

149.          (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class;

150.           IterTo API docTo body      : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body);

151.        --  Selects or unselects the row pointed to by the specified iterator.

153.        function Iter_Is_SelectedTo API docTo body

154.          (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class;

155.           IterTo API docTo body      : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body)

156.           return Boolean;

157.        --  Return True if the row pointed to by path is currently selected.

159.        procedure Select_AllTo API docTo body (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class);

160.        procedure Unselect_AllTo API docTo body (Selection : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class);

161.        --  Selects or unselects all the nodes.

162.        --  Selection must be set to Gtk_Selection_Multiple mode.

164.        procedure Select_RangeTo API docTo body

165.          (Selection  : access Gtk_Tree_Selection_RecordTo API docTo specTo body'Class;

166.           Start_Path : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec;

167.           End_Path   : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec);

168.        procedure Unselect_RangeTo API docTo body

169.          (Selection  : access Gtk_Tree_Selection_RecordTo API docTo specTo body;

170.           Start_Path : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec;

171.           End_Path   : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec);

172.        --  Selects or unselects a range of nodes, determined by Start_Path and

173.        --  End_Path inclusive

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

176.        -- Signals --

177.        -------------

179.        --  <signals>

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

181.        --

182.        --  - "changed"

183.        --    procedure Handler

184.        --      (Widget : access Gtk_Tree_Selection_Record'Class'Class);

185.        --    Emitted whenever the selection has (possibly) changed. Please note

186.        --    that this signal is mostly a hint. It may only be emitted once when a

187.        --    range of rows are selected, and it may occasionally be emitted when

188.        --    nothing has happened.

189.        --

190.        --  </signals>

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

194.     private

195.        type Gtk_Tree_Selection_RecordTo API docTo spec is

196.          new Glib.Object.GObject_RecordTo API docTo specTo body with null record;

198.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_tree_selection_get_type");

200.     end Gtk.Tree_SelectionTo API docTo specTo body;

202.     --   missing:

203.     --

204.     --    procedure Set_Select_Function

205.     --      (Selection : access Gtk_Tree_Selection_Record'Class;

206.     --       Func      : Gtk_Tree_Selection_Func;

207.     --       Data      : gpointer;

208.     --       Destroy   : Gtk_Destroy_Notify);

209.     --

210.     --    function Get_User_Data

211.     --      (Selection : access Gtk_Tree_Selection_Record'Class) return gpointer;