## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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

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

3.     --                                                                   --

4.     --                Copyright (C) 2006-2011, 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.     --  Gtk_Cell_Layout is an interface to be implemented by all objects which want

31.     --  to provide a Gtk_Tree_View_Column like API for packing cells, setting

32.     --  attributes and data funcs.

33.     --  The rendering of the widget is done through various Gtk_Cell_Renderer, and

34.     --  by reading data from a Gtk_Tree_Model.

35.     --  </description>

36.     --  <c_version>2.8.17</c_version>

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

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

40.     with Glib.TypesTo API docTo specTo body;

41.     with Gtk.Cell_RendererTo API docTo specTo body;

42.     with Gtk.Tree_ModelTo API docTo specTo body;

44.     package Gtk.Cell_LayoutTo API docTo specTo body is

46.        type Gtk_Cell_Layout is new Glib.Types.GType_InterfaceTo API docTo spec;

47.        --  An interface (similar to Java's interfaces) that can be implemented by

48.        --  tagged types derived from Glib.Object.GObject.

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

51.        --  Returns the internal type used for a Gtk_Cell_Layout interface

53.        procedure Pack_StartTo API docTo body

54.          (Cell_Layout : Gtk_Cell_LayoutTo API docTo spec;

55.           Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_RecordTo API docTo specTo body'Class;

56.           Expand      : Boolean);

57.        procedure Pack_EndTo API docTo body

58.          (Cell_Layout : Gtk_Cell_LayoutTo API docTo spec;

59.           Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_RecordTo API docTo specTo body'Class;

60.           Expand      : Boolean);

61.        --  Adds Cell to the beginning or end of Cell_Layout. If Expand is False,

62.        --  then the Cell is allocated no more space than it needs. Any unused space

63.        --  is divided evenly between cells for which Expand is True. Note that

64.        --  reusing the same cell renderer is not supported.

66.        procedure Add_AttributeTo API docTo body

67.          (Cell_Layout : Gtk_Cell_LayoutTo API docTo spec;

68.           Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_RecordTo API docTo specTo body'Class;

69.           Attribute   : String;

70.           Column      : GintTo API docTo spec);

71.        --  Adds an attribute mapping to the list in Cell_Layout. Column is the

72.        --  column of the model to get a value from, and Attribute is the parameter

73.        --  on Cell to be set from the value. So for example if column of the model

74.        --  contains strings, you could have the "text" attribute of

75.        --  Gtk_Cell_Renderer_Text get its values from column 2.

76.        --  To mark rows as insensitive, create a column containing booleans in

77.        --  your model, and add an attribute "sensitive" to your renderer that

78.        --  points to this column.

80.        procedure ClearTo API docTo body (Cell_Layout : Gtk_Cell_LayoutTo API docTo spec);

81.        --  Unsets all the mappings on all renderers on Cell_Layout and

82.        --  removes all renderers from Cell_Layout.

84.        procedure Clear_AttributesTo API docTo body

85.          (Cell_Layout : Gtk_Cell_LayoutTo API docTo spec;

86.           Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_RecordTo API docTo specTo body'Class);

87.        --  Clears all existing attributes previously set with Add_Attribute.

89.        procedure ReorderTo API docTo body

90.          (Cell_Layout : Gtk_Cell_LayoutTo API docTo spec;

91.           Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_RecordTo API docTo specTo body'Class;

92.           Position    : GintTo API docTo spec);

93.        --  Re-inserts Cell at Position. Note that Cell has already to be packed

94.        --  into Cell_layout for this to function properly.

96.        type Cell_Data_Func is access procedure

97.          (Cell_Layout : Gtk_Cell_LayoutTo API docTo spec;

98.           Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_RecordTo API docTo specTo body'Class;

99.           Model       : access Gtk.Tree_Model.Gtk_Tree_Model_RecordTo API docTo specTo body'Class;

100.           Iter        : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body);

101.        --  This subprogram can be used to globally modify an attribute of the

102.        --  Cell renderer.

103.        --  It should set the attributes of Cell as appropriate for this tree iter.

105.        procedure Set_Cell_Data_FuncTo API docTo body

106.          (Cell_Layout : Gtk_Cell_LayoutTo API docTo spec;

107.           Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_RecordTo API docTo specTo body'Class;

108.           Func        : Cell_Data_FuncTo API docTo spec);

109.        --  Sets the Cell_Data_Func to use for Cell_Layout. This function is used

110.        --  instead of the standard attributes mapping for setting the column value,

111.        --  and should set the value of Cell_layout's cell renderer(s) as

112.        --  appropriate. Func may be null to remove and older one.

113.        --  This allows you to compute the attributes dynamically from several

114.        --  columns of the model for instance

116.        generic

117.           type Data_Type (<>) is private;

118.        package Cell_Data_FunctionsTo API docTo body is

119.           type Cell_Data_Func is access procedure

120.             (Cell_Layout : Gtk_Cell_LayoutTo API docTo spec;

121.              Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_RecordTo API docTo specTo body'Class;

122.              Model       : access Gtk.Tree_Model.Gtk_Tree_Model_RecordTo API docTo specTo body'Class;

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

124.              Data        : Data_TypeTo API docTo spec);

126.           type Destroy_Notify is access procedure (Data : in out Data_TypeTo API docTo spec);

127.           --  Free the memory used by Data

129.           procedure Set_Cell_Data_FuncTo API docTo body

130.             (Cell_Layout : Gtk_Cell_LayoutTo API docTo spec;

131.              Cell        : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_RecordTo API docTo specTo body'Class;

132.              Func        : Cell_Data_FuncTo API docTo spec;

133.              Data        : Data_TypeTo API docTo spec;

134.              Destroy     : Destroy_NotifyTo API docTo spec := null);

135.           --  Same as the other Set_Cell_Data_Func, but passes an addition user

136.           --  data to the callback.

138.        private

139.           --  <doc_ignore>

140.           type Data_Type_Access is access Data_TypeTo API docTo spec;

142.           type Data_Type_Record is record

143.              Func    : Cell_Data_FuncTo API docTo spec;

144.              Destroy : Destroy_NotifyTo API docTo spec;

145.              Data    : Data_Type_Access;

146.           end record;

147.           type Data_Type_Record_Access is access Data_Type_Record;

148.           pragma Convention (C, Data_Type_Record_Access);

150.           procedure Internal_Destroy_Notify (Data : Data_Type_Record_Access);

151.           pragma Convention (C, Internal_Destroy_Notify);

153.           procedure Internal_Data_Cell_Data_Func

154.             (Cell_Layout       : Gtk_Cell_LayoutTo API docTo spec;

155.              Cell, Model, Iter : System.Address;

156.              Data              : Data_Type_Record_Access);

157.           pragma Convention (C, Internal_Data_Cell_Data_Func);

158.           --  </doc_ignore>

159.        end Cell_Data_FunctionsTo API docTo specTo body;

161.     private

162.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_cell_layout_get_type");

163.        pragma Import (C, ClearTo API docTo spec, "gtk_cell_layout_clear");

164.     end Gtk.Cell_LayoutTo API docTo specTo body;

166.     --  No binding: gtk_cell_layout_set_attributes