]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkcelllayout.sgml
e9e8fe21be567f1fb2adad6b86393b87338e4215
[~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 <!-- ##### STRUCT GtkCellLayout ##### -->
62 <para>
63
64 </para>
65
66
67 <!-- ##### STRUCT GtkCellLayoutIface ##### -->
68 <para>
69
70 </para>
71
72 @g_iface: 
73 @pack_start: 
74 @pack_end: 
75 @clear: 
76 @add_attribute: 
77 @set_cell_data_func: 
78 @clear_attributes: 
79 @reorder: 
80 @get_cells: 
81
82 <!-- ##### USER_FUNCTION GtkCellLayoutDataFunc ##### -->
83 <para>
84 A function which should set the value of @cell_layout's cell renderer(s)
85 as appropriate. 
86 </para>
87
88 @cell_layout: a #GtkCellLayout
89 @cell: the cell renderer whose value is to be set
90 @tree_model: the model
91 @iter: a #GtkTreeIter indicating the row to set the value for
92 @data: user data passed to gtk_cell_layout_set_cell_data_func()
93
94
95 <!-- ##### FUNCTION gtk_cell_layout_pack_start ##### -->
96 <para>
97
98 </para>
99
100 @cell_layout: 
101 @cell: 
102 @expand: 
103
104
105 <!-- ##### FUNCTION gtk_cell_layout_pack_end ##### -->
106 <para>
107
108 </para>
109
110 @cell_layout: 
111 @cell: 
112 @expand: 
113
114
115 <!-- ##### FUNCTION gtk_cell_layout_get_cells ##### -->
116 <para>
117
118 </para>
119
120 @cell_layout: 
121 @Returns: 
122
123
124 <!-- ##### FUNCTION gtk_cell_layout_reorder ##### -->
125 <para>
126
127 </para>
128
129 @cell_layout: 
130 @cell: 
131 @position: 
132
133
134 <!-- ##### FUNCTION gtk_cell_layout_clear ##### -->
135 <para>
136
137 </para>
138
139 @cell_layout: 
140
141
142 <!-- ##### FUNCTION gtk_cell_layout_set_attributes ##### -->
143 <para>
144
145 </para>
146
147 @cell_layout: 
148 @cell: 
149 @Varargs: 
150
151
152 <!-- ##### FUNCTION gtk_cell_layout_add_attribute ##### -->
153 <para>
154
155 </para>
156
157 @cell_layout: 
158 @cell: 
159 @attribute: 
160 @column: 
161
162
163 <!-- ##### FUNCTION gtk_cell_layout_set_cell_data_func ##### -->
164 <para>
165
166 </para>
167
168 @cell_layout: 
169 @cell: 
170 @func: 
171 @func_data: 
172 @destroy: 
173
174
175 <!-- ##### FUNCTION gtk_cell_layout_clear_attributes ##### -->
176 <para>
177
178 </para>
179
180 @cell_layout: 
181 @cell: 
182
183