]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkcelllayout.sgml
Make 3.0 parallel-installable to 2.x
[~andy/gtk] / docs / reference / gtk / tmpl / gtkcelllayout.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkCellLayout
3
4 <!-- ##### SECTION Short_Description ##### -->
5 An interface for packing cells
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 #GtkCellLayout is an interface to be implemented by all objects which
10 want to provide a #GtkTreeViewColumn-like API for packing cells, setting
11 attributes and data funcs. 
12 </para>
13
14 <para>
15 One of the notable features provided by implementations of GtkCellLayout
16 are <emphasis>attributes</emphasis>. Attributes let you set the properties
17 in flexible ways. They can just be set to constant values like regular
18 properties. But they can also be mapped to a column of the underlying 
19 tree model with gtk_cell_layout_set_attributes(), which means that the value 
20 of the attribute can change from cell to cell as they are rendered by the 
21 cell renderer. Finally, it is possible to specify a function with 
22 gtk_cell_layout_set_cell_data_func() that is called to determine the value 
23 of the attribute for each cell that is rendered.
24 </para>
25
26 <refsect2 id="GtkCellLayout-BUILDER-UI">
27 <title>GtkCellLayouts as GtkBuildable</title>
28 <para>
29 Implementations of GtkCellLayout which also implement the GtkBuildable 
30 interface (#GtkCellView, #GtkIconView, #GtkComboBox, #GtkComboBoxEntry, 
31 #GtkEntryCompletion, #GtkTreeViewColumn) accept GtkCellRenderer objects
32 as &lt;child&gt; elements in UI definitions. They support a custom 
33 &lt;attributes&gt; element for their children, which can contain 
34 multiple &lt;attribute&gt; elements. Each &lt;attribute&gt; element has 
35 a name attribute which specifies a property of the cell renderer; the 
36 content of the element is the attribute value.
37 </para>
38 <example>
39 <title>A UI definition fragment specifying attributes</title>
40 <programlisting><![CDATA[
41 <object class="GtkCellView">
42   <child>
43     <object class="GtkCellRendererText"/>
44     <attributes>
45       <attribute name="text">0</attribute>
46     </attributes>
47   </child>"
48 </object>
49 ]]></programlisting>
50 </example>
51 </refsect2>
52
53 <!-- ##### SECTION See_Also ##### -->
54 <para>
55
56 </para>
57
58 <!-- ##### SECTION Stability_Level ##### -->
59
60
61 <!-- ##### SECTION Image ##### -->
62
63
64 <!-- ##### STRUCT GtkCellLayout ##### -->
65 <para>
66
67 </para>
68
69
70 <!-- ##### STRUCT GtkCellLayoutIface ##### -->
71 <para>
72
73 </para>
74
75 @g_iface: 
76 @pack_start: 
77 @pack_end: 
78 @clear: 
79 @add_attribute: 
80 @set_cell_data_func: 
81 @clear_attributes: 
82 @reorder: 
83 @get_cells: 
84
85 <!-- ##### USER_FUNCTION GtkCellLayoutDataFunc ##### -->
86 <para>
87 A function which should set the value of @cell_layout's cell renderer(s)
88 as appropriate. 
89 </para>
90
91 @cell_layout: a #GtkCellLayout
92 @cell: the cell renderer whose value is to be set
93 @tree_model: the model
94 @iter: a #GtkTreeIter indicating the row to set the value for
95 @data: user data passed to gtk_cell_layout_set_cell_data_func()
96
97
98 <!-- ##### FUNCTION gtk_cell_layout_pack_start ##### -->
99 <para>
100
101 </para>
102
103 @cell_layout: 
104 @cell: 
105 @expand: 
106
107
108 <!-- ##### FUNCTION gtk_cell_layout_pack_end ##### -->
109 <para>
110
111 </para>
112
113 @cell_layout: 
114 @cell: 
115 @expand: 
116
117
118 <!-- ##### FUNCTION gtk_cell_layout_get_cells ##### -->
119 <para>
120
121 </para>
122
123 @cell_layout: 
124 @Returns: 
125
126
127 <!-- ##### FUNCTION gtk_cell_layout_reorder ##### -->
128 <para>
129
130 </para>
131
132 @cell_layout: 
133 @cell: 
134 @position: 
135
136
137 <!-- ##### FUNCTION gtk_cell_layout_clear ##### -->
138 <para>
139
140 </para>
141
142 @cell_layout: 
143
144
145 <!-- ##### FUNCTION gtk_cell_layout_set_attributes ##### -->
146 <para>
147
148 </para>
149
150 @cell_layout: 
151 @cell: 
152 @Varargs: 
153
154
155 <!-- ##### FUNCTION gtk_cell_layout_add_attribute ##### -->
156 <para>
157
158 </para>
159
160 @cell_layout: 
161 @cell: 
162 @attribute: 
163 @column: 
164
165
166 <!-- ##### FUNCTION gtk_cell_layout_set_cell_data_func ##### -->
167 <para>
168
169 </para>
170
171 @cell_layout: 
172 @cell: 
173 @func: 
174 @func_data: 
175 @destroy: 
176
177
178 <!-- ##### FUNCTION gtk_cell_layout_clear_attributes ##### -->
179 <para>
180
181 </para>
182
183 @cell_layout: 
184 @cell: 
185
186