1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 An interface for packing cells
7 <!-- ##### SECTION Long_Description ##### -->
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.
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.
26 <refsect2 id="GtkCellLayout-BUILDER-UI">
27 <title>GtkCellLayouts as GtkBuildable</title>
29 Implementations of GtkCellLayout which also implement the GtkBuildable
30 interface (#GtkCellView, #GtkIconView, #GtkComboBox, #GtkComboBoxEntry,
31 #GtkEntryCompletion, #GtkTreeViewColumn) accept GtkCellRenderer objects
32 as <child> elements in UI definitions. They support a custom
33 <attributes> element for their children, which can contain
34 multiple <attribute> elements. Each <attribute> element has
35 a name attribute which specifies a property of the cell renderer; the
36 content of the element is the attribute value.
39 <title>A UI definition fragment specifying attributes</title>
40 <programlisting><![CDATA[
41 <object class="GtkCellView">
43 <object class="GtkCellRendererText"/>
45 <attribute name="text">0</attribute>
53 <!-- ##### SECTION See_Also ##### -->
58 <!-- ##### SECTION Stability_Level ##### -->
61 <!-- ##### SECTION Image ##### -->
64 <!-- ##### STRUCT GtkCellLayout ##### -->
70 <!-- ##### STRUCT GtkCellLayoutIface ##### -->
85 <!-- ##### USER_FUNCTION GtkCellLayoutDataFunc ##### -->
87 A function which should set the value of @cell_layout's cell renderer(s)
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()
98 <!-- ##### FUNCTION gtk_cell_layout_pack_start ##### -->
108 <!-- ##### FUNCTION gtk_cell_layout_pack_end ##### -->
118 <!-- ##### FUNCTION gtk_cell_layout_get_cells ##### -->
127 <!-- ##### FUNCTION gtk_cell_layout_reorder ##### -->
137 <!-- ##### FUNCTION gtk_cell_layout_clear ##### -->
145 <!-- ##### FUNCTION gtk_cell_layout_set_attributes ##### -->
155 <!-- ##### FUNCTION gtk_cell_layout_add_attribute ##### -->
166 <!-- ##### FUNCTION gtk_cell_layout_set_cell_data_func ##### -->
178 <!-- ##### FUNCTION gtk_cell_layout_clear_attributes ##### -->