<?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="GtkCellRendererCombo">
<refmeta>
<refentrytitle role="top_of_page" id="GtkCellRendererCombo.top_of_page">GtkCellRendererCombo</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkCellRendererCombo</refname>
<refpurpose>Renders a combobox in a cell</refpurpose>
</refnamediv>

<refsect1 id="GtkCellRendererCombo.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="GtkCellRenderer"><returnvalue>GtkCellRenderer</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-cell-renderer-combo-new">gtk_cell_renderer_combo_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkCellRendererCombo.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="gboolean"><type>gboolean</type></link></entry><entry role="property_name"><link linkend="GtkCellRendererCombo--has-entry">has-entry</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="GtkTreeModel"><type>GtkTreeModel</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkCellRendererCombo--model">model</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="gint"><type>gint</type></link></entry><entry role="property_name"><link linkend="GtkCellRendererCombo--text-column">text-column</link></entry><entry role="property_flags">Read / Write</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkCellRendererCombo.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signal_proto_type" colwidth="150px"/>
<colspec colname="signal_proto_name" colwidth="300px"/>
<colspec colname="signal_proto_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkCellRendererCombo-changed">changed</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkCellRendererCombo.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="GtkCellRendererCombo-struct">GtkCellRendererCombo</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkCellRendererCombo.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkCellRenderer">GtkCellRenderer</link>
            <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkCellRendererText">GtkCellRendererText</link>
                <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkCellRendererCombo
</screen>
</refsect1>

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

<refsect1 id="GtkCellRendererCombo.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GtkCellRendererCombo"><type>GtkCellRendererCombo</type></link> renders text in a cell like <link linkend="GtkCellRendererText"><type>GtkCellRendererText</type></link> from
which it is derived. But while <link linkend="GtkCellRendererText"><type>GtkCellRendererText</type></link> offers a simple entry to
edit the text, <link linkend="GtkCellRendererCombo"><type>GtkCellRendererCombo</type></link> offers a <link linkend="GtkComboBox"><type>GtkComboBox</type></link>
widget to edit the text. The values to display in the combo box are taken from
the tree model specified in the <link linkend="GtkCellRendererCombo--model"><type>“model”</type></link> property.</para>
<para>The combo cell renderer takes care of adding a text cell renderer to the combo
box and sets it to display the column specified by its
<link linkend="GtkCellRendererCombo--text-column"><type>“text-column”</type></link> property. Further properties of the combo box
can be set in a handler for the <link linkend="GtkCellRenderer-editing-started"><type>“editing-started”</type></link> signal.</para>
<para>The <link linkend="GtkCellRendererCombo"><type>GtkCellRendererCombo</type></link> cell renderer was added in GTK+ 2.6.</para>

</refsect1>
<refsect1 id="GtkCellRendererCombo.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-cell-renderer-combo-new" role="function">
<title>gtk_cell_renderer_combo_new&#160;()</title>
<indexterm zone="gtk-cell-renderer-combo-new"><primary>gtk_cell_renderer_combo_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkCellRenderer"><returnvalue>GtkCellRenderer</returnvalue></link>&#160;*
gtk_cell_renderer_combo_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new <link linkend="GtkCellRendererCombo"><type>GtkCellRendererCombo</type></link>. 
Adjust how text is drawn using object properties. 
Object properties can be set globally (with <link linkend="g-object-set"><function>g_object_set()</function></link>). 
Also, with <link linkend="GtkTreeViewColumn"><type>GtkTreeViewColumn</type></link>, you can bind a property to a value 
in a <link linkend="GtkTreeModel"><type>GtkTreeModel</type></link>. For example, you can bind the “text” property 
on the cell renderer to a string value in the model, thus rendering 
a different string in each row of the <link linkend="GtkTreeView"><type>GtkTreeView</type></link>.</para>
<refsect3 id="gtk-cell-renderer-combo-new.returns" role="returns">
<title>Returns</title>
<para> the new cell renderer</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkCellRendererCombo.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkCellRendererCombo-struct" role="struct">
<title>GtkCellRendererCombo</title>
<indexterm zone="GtkCellRendererCombo-struct"><primary>GtkCellRendererCombo</primary></indexterm>
<programlisting language="C">typedef struct _GtkCellRendererCombo GtkCellRendererCombo;</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GtkCellRendererCombo.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkCellRendererCombo--has-entry" role="property"><title>The <literal>“has-entry”</literal> property</title>
<indexterm zone="GtkCellRendererCombo--has-entry"><primary>GtkCellRendererCombo:has-entry</primary></indexterm>
<programlisting>  “has-entry”                <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>If <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, the cell renderer will include an entry and allow to enter

values other than the ones in the popup list.</para>
<para>Owner: GtkCellRendererCombo</para>
<para>Flags: Read / Write</para>
<para>Default value: TRUE</para>
</refsect2>
<refsect2 id="GtkCellRendererCombo--model" role="property"><title>The <literal>“model”</literal> property</title>
<indexterm zone="GtkCellRendererCombo--model"><primary>GtkCellRendererCombo:model</primary></indexterm>
<programlisting>  “model”                    <link linkend="GtkTreeModel"><type>GtkTreeModel</type></link>&#160;*</programlisting>
<para>Holds a tree model containing the possible values for the combo box.

Use the text_column property to specify the column holding the values.</para>
<para>Owner: GtkCellRendererCombo</para>
<para>Flags: Read / Write</para>
</refsect2>
<refsect2 id="GtkCellRendererCombo--text-column" role="property"><title>The <literal>“text-column”</literal> property</title>
<indexterm zone="GtkCellRendererCombo--text-column"><primary>GtkCellRendererCombo:text-column</primary></indexterm>
<programlisting>  “text-column”              <link linkend="gint"><type>gint</type></link></programlisting>
<para>Specifies the model column which holds the possible values for the

combo box. </para>
<para>Note that this refers to the model specified in the model property,

not the model backing the tree view to which

this cell renderer is attached.</para>
<para><link linkend="GtkCellRendererCombo"><type>GtkCellRendererCombo</type></link> automatically adds a text cell renderer for

this column to its combo box.</para>
<para>Owner: GtkCellRendererCombo</para>
<para>Flags: Read / Write</para>
<para>Allowed values: &gt;= -1</para>
<para>Default value: -1</para>
</refsect2>

</refsect1>
<refsect1 id="GtkCellRendererCombo.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkCellRendererCombo-changed" role="signal"><title>The <literal>“changed”</literal> signal</title>
<indexterm zone="GtkCellRendererCombo-changed"><primary>GtkCellRendererCombo::changed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkCellRendererCombo"><type>GtkCellRendererCombo</type></link> *combo,
               <link linkend="gchar"><type>gchar</type></link>                *path_string,
               <link linkend="GtkTreeIter"><type>GtkTreeIter</type></link>          *new_iter,
               <link linkend="gpointer"><type>gpointer</type></link>              user_data)</programlisting>
<para>This signal is emitted each time after the user selected an item in
the combo box, either by using the mouse or the arrow keys.  Contrary
to GtkComboBox, GtkCellRendererCombo::changed is not emitted for
changes made to a selected item in the entry.  The argument <parameter>new_iter</parameter>

corresponds to the newly selected item in the combo box and it is relative
to the GtkTreeModel set via the model property on GtkCellRendererCombo.</para>
<para>Note that as soon as you change the model displayed in the tree view,
the tree view will immediately cease the editing operating.  This
means that you most probably want to refrain from changing the model
until the combo cell renderer emits the edited or editing_canceled signal.</para>
<refsect3 id="GtkCellRendererCombo-changed.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>combo</para></entry>
<entry role="parameter_description"><para>the object on which the signal is emitted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>path_string</para></entry>
<entry role="parameter_description"><para>a string of the path identifying the edited cell
(relative to the tree view model)</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>new_iter</para></entry>
<entry role="parameter_description"><para>the new iter selected in the combo box
(relative to the combo box model)</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2>
</refsect1>

</refentry>
