summaryrefslogtreecommitdiff
path: root/docs/reference/gtk/tmpl/gtkcelllayout.sgml
blob: e9e8fe21be567f1fb2adad6b86393b87338e4215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!-- ##### SECTION Title ##### -->
GtkCellLayout

<!-- ##### SECTION Short_Description ##### -->
An interface for packing cells

<!-- ##### SECTION Long_Description ##### -->
<para>
#GtkCellLayout is an interface to be implemented by all objects which
want to provide a #GtkTreeViewColumn-like API for packing cells, setting
attributes and data funcs. 
</para>

<para>
One of the notable features provided by implementations of GtkCellLayout
are <emphasis>attributes</emphasis>. Attributes let you set the properties
in flexible ways. They can just be set to constant values like regular
properties. But they can also be mapped to a column of the underlying 
tree model with gtk_cell_layout_set_attributes(), which means that the value 
of the attribute can change from cell to cell as they are rendered by the 
cell renderer. Finally, it is possible to specify a function with 
gtk_cell_layout_set_cell_data_func() that is called to determine the value 
of the attribute for each cell that is rendered.
</para>

<refsect2 id="GtkCellLayout-BUILDER-UI">
<title>GtkCellLayouts as GtkBuildable</title>
<para>
Implementations of GtkCellLayout which also implement the GtkBuildable 
interface (#GtkCellView, #GtkIconView, #GtkComboBox, #GtkComboBoxEntry, 
#GtkEntryCompletion, #GtkTreeViewColumn) accept GtkCellRenderer objects
as &lt;child&gt; elements in UI definitions. They support a custom 
&lt;attributes&gt; element for their children, which can contain 
multiple &lt;attribute&gt; elements. Each &lt;attribute&gt; element has 
a name attribute which specifies a property of the cell renderer; the 
content of the element is the attribute value.
</para>
<example>
<title>A UI definition fragment specifying attributes</title>
<programlisting><![CDATA[
<object class="GtkCellView">
  <child>
    <object class="GtkCellRendererText"/>
    <attributes>
      <attribute name="text">0</attribute>
    </attributes>
  </child>"
</object>
]]></programlisting>
</example>
</refsect2>

<!-- ##### SECTION See_Also ##### -->
<para>

</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### STRUCT GtkCellLayout ##### -->
<para>

</para>


<!-- ##### STRUCT GtkCellLayoutIface ##### -->
<para>

</para>

@g_iface: 
@pack_start: 
@pack_end: 
@clear: 
@add_attribute: 
@set_cell_data_func: 
@clear_attributes: 
@reorder: 
@get_cells: 

<!-- ##### USER_FUNCTION GtkCellLayoutDataFunc ##### -->
<para>
A function which should set the value of @cell_layout's cell renderer(s)
as appropriate. 
</para>

@cell_layout: a #GtkCellLayout
@cell: the cell renderer whose value is to be set
@tree_model: the model
@iter: a #GtkTreeIter indicating the row to set the value for
@data: user data passed to gtk_cell_layout_set_cell_data_func()


<!-- ##### FUNCTION gtk_cell_layout_pack_start ##### -->
<para>

</para>

@cell_layout: 
@cell: 
@expand: 


<!-- ##### FUNCTION gtk_cell_layout_pack_end ##### -->
<para>

</para>

@cell_layout: 
@cell: 
@expand: 


<!-- ##### FUNCTION gtk_cell_layout_get_cells ##### -->
<para>

</para>

@cell_layout: 
@Returns: 


<!-- ##### FUNCTION gtk_cell_layout_reorder ##### -->
<para>

</para>

@cell_layout: 
@cell: 
@position: 


<!-- ##### FUNCTION gtk_cell_layout_clear ##### -->
<para>

</para>

@cell_layout: 


<!-- ##### FUNCTION gtk_cell_layout_set_attributes ##### -->
<para>

</para>

@cell_layout: 
@cell: 
@Varargs: 


<!-- ##### FUNCTION gtk_cell_layout_add_attribute ##### -->
<para>

</para>

@cell_layout: 
@cell: 
@attribute: 
@column: 


<!-- ##### FUNCTION gtk_cell_layout_set_cell_data_func ##### -->
<para>

</para>

@cell_layout: 
@cell: 
@func: 
@func_data: 
@destroy: 


<!-- ##### FUNCTION gtk_cell_layout_clear_attributes ##### -->
<para>

</para>

@cell_layout: 
@cell: