<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="GtkCellLayout">
<refmeta>
<refentrytitle role="top_of_page" id="GtkCellLayout.top_of_page">GtkCellLayout</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkCellLayout</refname>
<refpurpose>An interface for packing cells</refpurpose>
</refnamediv>

<refsect1 id="GtkCellLayout.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><phrase role="c_punctuation">(</phrase><link linkend="GtkCellLayoutDataFunc">*GtkCellLayoutDataFunc</link><phrase role="c_punctuation">)</phrase>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-cell-layout-pack-start">gtk_cell_layout_pack_start</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-cell-layout-pack-end">gtk_cell_layout_pack_end</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkCellArea"><returnvalue>GtkCellArea</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-cell-layout-get-area">gtk_cell_layout_get_area</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GList"><returnvalue>GList</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-cell-layout-get-cells">gtk_cell_layout_get_cells</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-cell-layout-reorder">gtk_cell_layout_reorder</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-cell-layout-clear">gtk_cell_layout_clear</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-cell-layout-set-attributes">gtk_cell_layout_set_attributes</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-cell-layout-add-attribute">gtk_cell_layout_add_attribute</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-cell-layout-set-cell-data-func">gtk_cell_layout_set_cell_data_func</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-cell-layout-clear-attributes">gtk_cell_layout_clear_attributes</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkCellLayout.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GtkCellLayout-struct">GtkCellLayout</link></entry></row>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GtkCellLayoutIface">GtkCellLayoutIface</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkCellLayout.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GInterface">GInterface</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkCellLayout
</screen>
</refsect1>
<refsect1 id="GtkCellLayout.prerequisites" role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
<para>
GtkCellLayout requires
 <link linkend="GObject">GObject</link>.</para>

</refsect1>
<refsect1 id="GtkCellLayout.implementations" role="implementations">
<title role="implementations.title">Known Implementations</title>
<para>
GtkCellLayout is implemented by
 <link linkend="GtkCellArea">GtkCellArea</link>,  <link linkend="GtkCellAreaBox">GtkCellAreaBox</link>,  <link linkend="GtkCellView">GtkCellView</link>,  <link linkend="GtkComboBox">GtkComboBox</link>,  <link linkend="GtkComboBoxText">GtkComboBoxText</link>,  <link linkend="GtkEntryCompletion">GtkEntryCompletion</link>,  <link linkend="GtkIconView">GtkIconView</link> and  <link linkend="GtkTreeViewColumn">GtkTreeViewColumn</link>.</para>

</refsect1>

<refsect1 id="GtkCellLayout.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkCellLayout.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> is an interface to be implemented by all objects which
want to provide a <link linkend="GtkTreeViewColumn"><type>GtkTreeViewColumn</type></link> like API for packing cells,
setting attributes and data funcs.</para>
<para>One of the notable features provided by implementations of 
GtkCellLayout are attributes. 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 <link linkend="gtk-cell-layout-set-attributes"><function>gtk_cell_layout_set_attributes()</function></link>, 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
<link linkend="gtk-cell-layout-set-cell-data-func"><function>gtk_cell_layout_set_cell_data_func()</function></link> that is called to determine the
value of the attribute for each cell that is rendered.</para>
<refsect2><title>GtkCellLayouts as GtkBuildable</title><para>Implementations of GtkCellLayout which also implement the GtkBuildable
interface (<link linkend="GtkCellView"><type>GtkCellView</type></link>, <link linkend="GtkIconView"><type>GtkIconView</type></link>, <link linkend="GtkComboBox"><type>GtkComboBox</type></link>,
<link linkend="GtkEntryCompletion"><type>GtkEntryCompletion</type></link>, <link linkend="GtkTreeViewColumn"><type>GtkTreeViewColumn</type></link>) accept GtkCellRenderer objects
as &lt;child> elements in UI definitions. They support a custom &lt;attributes>
element for their children, which can contain multiple &lt;attribute>
elements. Each &lt;attribute> element has a name attribute which specifies
a property of the cell renderer; the content of the element is the
attribute value.</para>
<para>This is an example of a UI definition fragment specifying attributes:</para>
<informalexample><programlisting role="example"><![CDATA[
<object class="GtkCellView">
  <child>
    <object class="GtkCellRendererText"/>
    <attributes>
      <attribute name="text">0</attribute>
    </attributes>
  </child>"
</object>
]]></programlisting></informalexample>
<para></para>
<para>Furthermore for implementations of GtkCellLayout that use a <link linkend="GtkCellArea"><type>GtkCellArea</type></link>
to lay out cells (all GtkCellLayouts in GTK+ use a GtkCellArea)
<link linkend="cell-properties">cell properties</link> can also be defined in the format by
specifying the custom &lt;cell-packing> attribute which can contain multiple
&lt;property> elements defined in the normal way.</para>
<para>Here is a UI definition fragment specifying cell properties:</para>
<informalexample><programlisting role="example"><![CDATA[
<object class="GtkTreeViewColumn">
  <child>
    <object class="GtkCellRendererText"/>
    <cell-packing>
      <property name="align">True</property>
      <property name="expand">False</property>
    </cell-packing>
  </child>"
</object>
]]></programlisting></informalexample>
<para></para>
</refsect2>
<refsect2><title>Subclassing GtkCellLayout implementations</title><para>When subclassing a widget that implements <link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> like
<link linkend="GtkIconView"><type>GtkIconView</type></link> or <link linkend="GtkComboBox"><type>GtkComboBox</type></link>, there are some considerations related
to the fact that these widgets internally use a <link linkend="GtkCellArea"><type>GtkCellArea</type></link>.
The cell area is exposed as a construct-only property by these
widgets. This means that it is possible to e.g. do</para>
<informalexample><programlisting role="example"><![CDATA[
combo = g_object_new (GTK_TYPE_COMBO_BOX, "cell-area", my_cell_area, NULL);
]]></programlisting></informalexample>
<para></para>
<para>to use a custom cell area with a combo box. But construct properties
are only initialized after instance <link linkend="init"><function>init()</function></link>
functions have run, which means that using functions which rely on
the existence of the cell area in your subclass’ <link linkend="init"><function>init()</function></link> function will
cause the default cell area to be instantiated. In this case, a provided
construct property value will be ignored (with a warning, to alert
you to the problem).</para>
<informalexample><programlisting role="example"><![CDATA[
static void
my_combo_box_init (MyComboBox *b)
{
  GtkCellRenderer *cell;

  cell = gtk_cell_renderer_pixbuf_new ();
  // The following call causes the default cell area for combo boxes,
  // a GtkCellAreaBox, to be instantiated
  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (b), cell, FALSE);
  ...
}

GtkWidget *
my_combo_box_new (GtkCellArea *area)
{
  // This call is going to cause a warning about area being ignored
  return g_object_new (MY_TYPE_COMBO_BOX, "cell-area", area, NULL);
}
]]></programlisting></informalexample>
<para></para>
<para>If supporting alternative cell areas with your derived widget is
not important, then this does not have to concern you. If you want
to support alternative cell areas, you can do so by moving the
problematic calls out of <link linkend="init"><function>init()</function></link> and into a <link linkend="constructor"><function>constructor()</function></link>
for your class.</para>
</refsect2>

</refsect1>
<refsect1 id="GtkCellLayout.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="GtkCellLayoutDataFunc" role="function">
<title>GtkCellLayoutDataFunc&#160;()</title>
<indexterm zone="GtkCellLayoutDataFunc"><primary>GtkCellLayoutDataFunc</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
<phrase role="c_punctuation">(</phrase>*GtkCellLayoutDataFunc<phrase role="c_punctuation">)</phrase> (<parameter><link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> *cell_layout</parameter>,
                          <parameter><link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link> *cell</parameter>,
                          <parameter><link linkend="GtkTreeModel"><type>GtkTreeModel</type></link> *tree_model</parameter>,
                          <parameter><link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> *iter</parameter>,
                          <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>);</programlisting>
<para>A function which should set the value of <parameter>cell_layout</parameter>
’s cell renderer(s)
as appropriate.</para>
<refsect3 id="GtkCellLayoutDataFunc.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>cell_layout</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellLayout"><type>GtkCellLayout</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cell</para></entry>
<entry role="parameter_description"><para>the cell renderer whose value is to be set</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>tree_model</para></entry>
<entry role="parameter_description"><para>the model</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>iter</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link> indicating the row to set the value for</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>user data passed to <link linkend="gtk-cell-layout-set-cell-data-func"><function>gtk_cell_layout_set_cell_data_func()</function></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>closure</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-cell-layout-pack-start" role="function">
<title>gtk_cell_layout_pack_start&#160;()</title>
<indexterm zone="gtk-cell-layout-pack-start"><primary>gtk_cell_layout_pack_start</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_cell_layout_pack_start (<parameter><link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> *cell_layout</parameter>,
                            <parameter><link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link> *cell</parameter>,
                            <parameter><link linkend="gboolean"><type>gboolean</type></link> expand</parameter>);</programlisting>
<para>Packs the <parameter>cell</parameter>
 into the beginning of <parameter>cell_layout</parameter>
. If <parameter>expand</parameter>
 is <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>,
then the <parameter>cell</parameter>
 is allocated no more space than it needs. Any unused space
is divided evenly between cells for which <parameter>expand</parameter>
 is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>.</para>
<para>Note that reusing the same cell renderer is not supported.</para>
<refsect3 id="gtk-cell-layout-pack-start.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>cell_layout</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellLayout"><type>GtkCellLayout</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cell</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>expand</para></entry>
<entry role="parameter_description"><para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>cell</parameter>
is to be given extra space allocated to <parameter>cell_layout</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-cell-layout-pack-end" role="function">
<title>gtk_cell_layout_pack_end&#160;()</title>
<indexterm zone="gtk-cell-layout-pack-end"><primary>gtk_cell_layout_pack_end</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_cell_layout_pack_end (<parameter><link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> *cell_layout</parameter>,
                          <parameter><link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link> *cell</parameter>,
                          <parameter><link linkend="gboolean"><type>gboolean</type></link> expand</parameter>);</programlisting>
<para>Adds the <parameter>cell</parameter>
 to the end of <parameter>cell_layout</parameter>
. If <parameter>expand</parameter>
 is <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, then the
<parameter>cell</parameter>
 is allocated no more space than it needs. Any unused space is
divided evenly between cells for which <parameter>expand</parameter>
 is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>.</para>
<para>Note that reusing the same cell renderer is not supported.</para>
<refsect3 id="gtk-cell-layout-pack-end.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>cell_layout</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellLayout"><type>GtkCellLayout</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cell</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>expand</para></entry>
<entry role="parameter_description"><para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>cell</parameter>
is to be given extra space allocated to <parameter>cell_layout</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-cell-layout-get-area" role="function">
<title>gtk_cell_layout_get_area&#160;()</title>
<indexterm zone="gtk-cell-layout-get-area"><primary>gtk_cell_layout_get_area</primary></indexterm>
<programlisting language="C"><link linkend="GtkCellArea"><returnvalue>GtkCellArea</returnvalue></link>&#160;*
gtk_cell_layout_get_area (<parameter><link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> *cell_layout</parameter>);</programlisting>
<para>Returns the underlying <link linkend="GtkCellArea"><type>GtkCellArea</type></link> which might be <parameter>cell_layout</parameter>

if called on a <link linkend="GtkCellArea"><type>GtkCellArea</type></link> or might be <link linkend="NULL:CAPS"><literal>NULL</literal></link> if no <link linkend="GtkCellArea"><type>GtkCellArea</type></link>
is used by <parameter>cell_layout</parameter>
.</para>
<refsect3 id="gtk-cell-layout-get-area.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>cell_layout</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellLayout"><type>GtkCellLayout</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-cell-layout-get-area.returns" role="returns">
<title>Returns</title>
<para>the cell area used by <parameter>cell_layout</parameter>
,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> in case no cell area is used. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-cell-layout-get-cells" role="function">
<title>gtk_cell_layout_get_cells&#160;()</title>
<indexterm zone="gtk-cell-layout-get-cells"><primary>gtk_cell_layout_get_cells</primary></indexterm>
<programlisting language="C"><link linkend="GList"><returnvalue>GList</returnvalue></link>&#160;*
gtk_cell_layout_get_cells (<parameter><link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> *cell_layout</parameter>);</programlisting>
<para>Returns the cell renderers which have been added to <parameter>cell_layout</parameter>
.</para>
<refsect3 id="gtk-cell-layout-get-cells.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>cell_layout</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellLayout"><type>GtkCellLayout</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-cell-layout-get-cells.returns" role="returns">
<title>Returns</title>
<para>a list of cell renderers. The list, but not the renderers has
been newly allocated and should be freed with <link linkend="g-list-free"><function>g_list_free()</function></link>
when no longer needed. </para>
<para><emphasis role="annotation">[<acronym>element-type</acronym> GtkCellRenderer][<acronym>transfer container</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-cell-layout-reorder" role="function">
<title>gtk_cell_layout_reorder&#160;()</title>
<indexterm zone="gtk-cell-layout-reorder"><primary>gtk_cell_layout_reorder</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_cell_layout_reorder (<parameter><link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> *cell_layout</parameter>,
                         <parameter><link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link> *cell</parameter>,
                         <parameter><link linkend="gint"><type>gint</type></link> position</parameter>);</programlisting>
<para>Re-inserts <parameter>cell</parameter>
 at <parameter>position</parameter>
.</para>
<para>Note that <parameter>cell</parameter>
 has already to be packed into <parameter>cell_layout</parameter>

for this to function properly.</para>
<refsect3 id="gtk-cell-layout-reorder.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>cell_layout</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellLayout"><type>GtkCellLayout</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cell</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link> to reorder</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>new position to insert <parameter>cell</parameter>
at</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-cell-layout-clear" role="function">
<title>gtk_cell_layout_clear&#160;()</title>
<indexterm zone="gtk-cell-layout-clear"><primary>gtk_cell_layout_clear</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_cell_layout_clear (<parameter><link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> *cell_layout</parameter>);</programlisting>
<para>Unsets all the mappings on all renderers on <parameter>cell_layout</parameter>
 and
removes all renderers from <parameter>cell_layout</parameter>
.</para>
<refsect3 id="gtk-cell-layout-clear.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>cell_layout</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellLayout"><type>GtkCellLayout</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-cell-layout-set-attributes" role="function">
<title>gtk_cell_layout_set_attributes&#160;()</title>
<indexterm zone="gtk-cell-layout-set-attributes"><primary>gtk_cell_layout_set_attributes</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_cell_layout_set_attributes (<parameter><link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> *cell_layout</parameter>,
                                <parameter><link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link> *cell</parameter>,
                                <parameter>...</parameter>);</programlisting>
<para>Sets the attributes in list as the attributes of <parameter>cell_layout</parameter>
.</para>
<para>The attributes should be in attribute/column order, as in
<link linkend="gtk-cell-layout-add-attribute"><function>gtk_cell_layout_add_attribute()</function></link>. All existing attributes are
removed, and replaced with the new attributes.</para>
<refsect3 id="gtk-cell-layout-set-attributes.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>cell_layout</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellLayout"><type>GtkCellLayout</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cell</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>a <link linkend="NULL:CAPS"><literal>NULL</literal></link>-terminated list of attributes</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-cell-layout-add-attribute" role="function">
<title>gtk_cell_layout_add_attribute&#160;()</title>
<indexterm zone="gtk-cell-layout-add-attribute"><primary>gtk_cell_layout_add_attribute</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_cell_layout_add_attribute (<parameter><link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> *cell_layout</parameter>,
                               <parameter><link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link> *cell</parameter>,
                               <parameter>const <link linkend="gchar"><type>gchar</type></link> *attribute</parameter>,
                               <parameter><link linkend="gint"><type>gint</type></link> column</parameter>);</programlisting>
<para>Adds an attribute mapping to the list in <parameter>cell_layout</parameter>
.</para>
<para>The <parameter>column</parameter>
 is the column of the model to get a value from, and the
<parameter>attribute</parameter>
 is the parameter on <parameter>cell</parameter>
 to be set from the value. So for
example if column 2 of the model contains strings, you could have the
“text” attribute of a <link linkend="GtkCellRendererText"><type>GtkCellRendererText</type></link> get its values from column 2.</para>
<refsect3 id="gtk-cell-layout-add-attribute.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>cell_layout</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellLayout"><type>GtkCellLayout</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cell</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>attribute</para></entry>
<entry role="parameter_description"><para>an attribute on the renderer</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>column</para></entry>
<entry role="parameter_description"><para>the column position on the model to get the attribute from</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-cell-layout-set-cell-data-func" role="function">
<title>gtk_cell_layout_set_cell_data_func&#160;()</title>
<indexterm zone="gtk-cell-layout-set-cell-data-func"><primary>gtk_cell_layout_set_cell_data_func</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_cell_layout_set_cell_data_func (<parameter><link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> *cell_layout</parameter>,
                                    <parameter><link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link> *cell</parameter>,
                                    <parameter><link linkend="GtkCellLayoutDataFunc"><type>GtkCellLayoutDataFunc</type></link> func</parameter>,
                                    <parameter><link linkend="gpointer"><type>gpointer</type></link> func_data</parameter>,
                                    <parameter><link linkend="GDestroyNotify"><type>GDestroyNotify</type></link> destroy</parameter>);</programlisting>
<para>Sets the <link linkend="GtkCellLayoutDataFunc"><type>GtkCellLayoutDataFunc</type></link> to use for <parameter>cell_layout</parameter>
.</para>
<para>This function is used instead of the standard attributes mapping
for setting the column value, and should set the value of <parameter>cell_layout</parameter>
’s
cell renderer(s) as appropriate.</para>
<para><parameter>func</parameter>
 may be <link linkend="NULL:CAPS"><literal>NULL</literal></link> to remove a previously set function.</para>
<refsect3 id="gtk-cell-layout-set-cell-data-func.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>cell_layout</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellLayout"><type>GtkCellLayout</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cell</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>func</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkCellLayoutDataFunc"><type>GtkCellLayoutDataFunc</type></link> to use, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>func_data</para></entry>
<entry role="parameter_description"><para>user data for <parameter>func</parameter>
. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>closure</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>destroy</para></entry>
<entry role="parameter_description"><para>destroy notify for <parameter>func_data</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-cell-layout-clear-attributes" role="function">
<title>gtk_cell_layout_clear_attributes&#160;()</title>
<indexterm zone="gtk-cell-layout-clear-attributes"><primary>gtk_cell_layout_clear_attributes</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_cell_layout_clear_attributes (<parameter><link linkend="GtkCellLayout"><type>GtkCellLayout</type></link> *cell_layout</parameter>,
                                  <parameter><link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link> *cell</parameter>);</programlisting>
<para>Clears all existing attributes previously set with
<link linkend="gtk-cell-layout-set-attributes"><function>gtk_cell_layout_set_attributes()</function></link>.</para>
<refsect3 id="gtk-cell-layout-clear-attributes.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>cell_layout</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellLayout"><type>GtkCellLayout</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cell</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkCellRenderer"><type>GtkCellRenderer</type></link> to clear the attribute mapping on</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkCellLayout.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkCellLayout-struct" role="struct">
<title>GtkCellLayout</title>
<indexterm zone="GtkCellLayout-struct"><primary>GtkCellLayout</primary></indexterm>
<programlisting language="C">typedef struct _GtkCellLayout GtkCellLayout;</programlisting>
</refsect2>
<refsect2 id="GtkCellLayoutIface" role="struct">
<title>struct GtkCellLayoutIface</title>
<indexterm zone="GtkCellLayoutIface"><primary>GtkCellLayoutIface</primary></indexterm>
<programlisting language="C">struct GtkCellLayoutIface {
  /* Virtual Table */
  void (* pack_start)         (GtkCellLayout         *cell_layout,
                               GtkCellRenderer       *cell,
                               gboolean               expand);
  void (* pack_end)           (GtkCellLayout         *cell_layout,
                               GtkCellRenderer       *cell,
                               gboolean               expand);
  void (* clear)              (GtkCellLayout         *cell_layout);
  void (* add_attribute)      (GtkCellLayout         *cell_layout,
                               GtkCellRenderer       *cell,
                               const gchar           *attribute,
                               gint                   column);
  void (* set_cell_data_func) (GtkCellLayout         *cell_layout,
                               GtkCellRenderer       *cell,
                               GtkCellLayoutDataFunc  func,
                               gpointer               func_data,
                               GDestroyNotify         destroy);
  void (* clear_attributes)   (GtkCellLayout         *cell_layout,
                               GtkCellRenderer       *cell);
  void (* reorder)            (GtkCellLayout         *cell_layout,
                               GtkCellRenderer       *cell,
                               gint                   position);
  GList* (* get_cells)        (GtkCellLayout         *cell_layout);

  GtkCellArea *(* get_area)   (GtkCellLayout         *cell_layout);
};
</programlisting>
<refsect3 id="GtkCellLayoutIface.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkCellLayoutIface.pack-start">pack_start</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Packs the cell into the beginning of cell_layout.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkCellLayoutIface.pack-end">pack_end</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Adds the cell to the end of cell_layout.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkCellLayoutIface.clear">clear</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Unsets all the mappings on all renderers on cell_layout and
removes all renderers from cell_layout.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkCellLayoutIface.add-attribute">add_attribute</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Adds an attribute mapping to the list in
cell_layout.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkCellLayoutIface.set-cell-data-func">set_cell_data_func</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Sets the <link linkend="GtkCellLayoutDataFunc"><type>GtkCellLayoutDataFunc</type></link> to use for
cell_layout.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkCellLayoutIface.clear-attributes">clear_attributes</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Clears all existing attributes previously set
with <link linkend="gtk-cell-layout-set-attributes"><function>gtk_cell_layout_set_attributes()</function></link>.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkCellLayoutIface.reorder">reorder</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Re-inserts cell at position.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkCellLayoutIface.get-cells">get_cells</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Get the cell renderers which have been added to
cell_layout.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkCellLayoutIface.get-area">get_area</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Get the underlying <link linkend="GtkCellArea"><type>GtkCellArea</type></link> which might be
cell_layout if called on a <link linkend="GtkCellArea"><type>GtkCellArea</type></link> or might be NULL if no
<link linkend="GtkCellArea"><type>GtkCellArea</type></link> is used by cell_layout.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3>
</refsect2>

</refsect1>

</refentry>
