<?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="GtkTreeExpander">
<refmeta>
<refentrytitle role="top_of_page" id="GtkTreeExpander.top_of_page">GtkTreeExpander</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkTreeExpander</refname>
<refpurpose>An indenting expander button for use in a tree list</refpurpose>
</refnamediv>

<refsect1 id="GtkTreeExpander.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="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-tree-expander-new">gtk_tree_expander_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-tree-expander-get-child">gtk_tree_expander_get_child</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-tree-expander-set-child">gtk_tree_expander_set_child</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gpointer"><returnvalue>gpointer</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-tree-expander-get-item">gtk_tree_expander_get_item</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkTreeListRow"><returnvalue>GtkTreeListRow</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-tree-expander-get-list-row">gtk_tree_expander_get_list_row</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-tree-expander-set-list-row">gtk_tree_expander_set_list_row</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkTreeExpander.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="GtkWidget"><type>GtkWidget</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkTreeExpander--child">child</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="GObject"><type>GObject</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkTreeExpander--item">item</link></entry><entry role="property_flags">Read</entry></row>
<row><entry role="property_type"><link linkend="GtkTreeListRow"><type>GtkTreeListRow</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkTreeExpander--list-row">list-row</link></entry><entry role="property_flags">Read / Write</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkTreeExpander.actions" role="actions">
<title role="actions.title">Actions</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="actions_none" colwidth="150px"/>
<colspec colname="actions_name" colwidth="300px"/>
<colspec colname="actions_param" colwidth="200px"/>
<tbody>
<row><entry></entry><entry role="action_name"><link linkend="GtkTreeExpander|listitem.toggle-expand">listitem.toggle-expand</link></entry><entry role="parameter_type"></entry></row>
<row><entry></entry><entry role="action_name"><link linkend="GtkTreeExpander|listitem.collapse">listitem.collapse</link></entry><entry role="parameter_type"></entry></row>
<row><entry></entry><entry role="action_name"><link linkend="GtkTreeExpander|listitem.expand">listitem.expand</link></entry><entry role="parameter_type"></entry></row>

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

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkTreeExpander.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="GtkWidget">GtkWidget</link>
            <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkTreeExpander
</screen>
</refsect1>
<refsect1 id="GtkTreeExpander.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkTreeExpander implements
 <link linkend="GtkAccessible">GtkAccessible</link>,  <link linkend="GtkBuildable">GtkBuildable</link> and  <link linkend="GtkConstraintTarget">GtkConstraintTarget</link>.</para>

</refsect1>

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

<refsect1 id="GtkTreeExpander.description" role="desc">
<title role="desc.title">Description</title>
<para>GtkTreeExpander is a widget that provides an expander for a list.</para>
<para>It is typically placed as a bottommost child into a <link linkend="GtkListView"><type>GtkListView</type></link> to allow
users to expand and collapse children in a list with a <link linkend="GtkTreeListModel"><type>GtkTreeListModel</type></link>.
It will provide the common UI elements, gestures and keybindings for this
purpose.</para>
<para>On top of this, the "listitem.expand", "listitem.collapse" and
"listitem.toggle-expand" actions are provided to allow adding custom UI
for managing expanded state.</para>
<para>The <link linkend="GtkTreeListModel"><type>GtkTreeListModel</type></link> must be set to not be passthrough. Then it will provide
<link linkend="GtkTreeListRow"><type>GtkTreeListRow</type></link> items which can be set via <link linkend="gtk-tree-expander-set-list-row"><function>gtk_tree_expander_set_list_row()</function></link>
on the expander. The expander will then watch that row item automatically.  
<link linkend="gtk-tree-expander-set-child"><function>gtk_tree_expander_set_child()</function></link> sets the widget that displays the actual row
contents.</para>
<refsect2><title>CSS nodes</title><informalexample><programlisting role="example"><![CDATA[
treeexpander
├── [indent]*
├── [expander]
╰── <child>
]]></programlisting></informalexample>
<para></para>
<para>GtkTreeExpander has zero or one CSS nodes with the name "expander" that should
display the expander icon. The node will be <literal>:checked</literal> when it is expanded.
If the node is not expandable, an "indent" node will be displayed instead.</para>
<para>For every level of depth, another "indent" node is prepended.</para>
</refsect2>

</refsect1>
<refsect1 id="GtkTreeExpander.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-tree-expander-new" role="function">
<title>gtk_tree_expander_new&#160;()</title>
<indexterm zone="gtk-tree-expander-new"><primary>gtk_tree_expander_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_tree_expander_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new <link linkend="GtkTreeExpander"><type>GtkTreeExpander</type></link></para>
<refsect3 id="gtk-tree-expander-new.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkTreeExpander"><type>GtkTreeExpander</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-expander-get-child" role="function">
<title>gtk_tree_expander_get_child&#160;()</title>
<indexterm zone="gtk-tree-expander-get-child"><primary>gtk_tree_expander_get_child</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_tree_expander_get_child (<parameter><link linkend="GtkTreeExpander"><type>GtkTreeExpander</type></link> *self</parameter>);</programlisting>
<para>Gets the child widget displayed by <parameter>self</parameter>
.</para>
<refsect3 id="gtk-tree-expander-get-child.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeExpander"><type>GtkTreeExpander</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-expander-get-child.returns" role="returns">
<title>Returns</title>
<para>The child displayed by <parameter>self</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-expander-set-child" role="function">
<title>gtk_tree_expander_set_child&#160;()</title>
<indexterm zone="gtk-tree-expander-set-child"><primary>gtk_tree_expander_set_child</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_tree_expander_set_child (<parameter><link linkend="GtkTreeExpander"><type>GtkTreeExpander</type></link> *self</parameter>,
                             <parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *child</parameter>);</programlisting>
<para>Sets the content widget to display.</para>
<refsect3 id="gtk-tree-expander-set-child.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeExpander"><type>GtkTreeExpander</type></link> widget</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>child</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkWidget"><type>GtkWidget</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-tree-expander-get-item" role="function">
<title>gtk_tree_expander_get_item&#160;()</title>
<indexterm zone="gtk-tree-expander-get-item"><primary>gtk_tree_expander_get_item</primary></indexterm>
<programlisting language="C"><link linkend="gpointer"><returnvalue>gpointer</returnvalue></link>
gtk_tree_expander_get_item (<parameter><link linkend="GtkTreeExpander"><type>GtkTreeExpander</type></link> *self</parameter>);</programlisting>
<para>Forwards the item set on the <link linkend="GtkTreeListRow"><type>GtkTreeListRow</type></link> that <parameter>self</parameter>
 is managing.</para>
<para>This call is essentially equivalent to calling
<literal>gtk_tree_list_row_get_item (gtk_tree_expander_get_list_row (@self))</literal>.</para>
<refsect3 id="gtk-tree-expander-get-item.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeExpander"><type>GtkTreeExpander</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-expander-get-item.returns" role="returns">
<title>Returns</title>
<para>The item of the row. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-expander-get-list-row" role="function">
<title>gtk_tree_expander_get_list_row&#160;()</title>
<indexterm zone="gtk-tree-expander-get-list-row"><primary>gtk_tree_expander_get_list_row</primary></indexterm>
<programlisting language="C"><link linkend="GtkTreeListRow"><returnvalue>GtkTreeListRow</returnvalue></link>&#160;*
gtk_tree_expander_get_list_row (<parameter><link linkend="GtkTreeExpander"><type>GtkTreeExpander</type></link> *self</parameter>);</programlisting>
<para>Gets the list row managed by <parameter>self</parameter>
.</para>
<refsect3 id="gtk-tree-expander-get-list-row.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeExpander"><type>GtkTreeExpander</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-expander-get-list-row.returns" role="returns">
<title>Returns</title>
<para>The list row displayed by <parameter>self</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-expander-set-list-row" role="function">
<title>gtk_tree_expander_set_list_row&#160;()</title>
<indexterm zone="gtk-tree-expander-set-list-row"><primary>gtk_tree_expander_set_list_row</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_tree_expander_set_list_row (<parameter><link linkend="GtkTreeExpander"><type>GtkTreeExpander</type></link> *self</parameter>,
                                <parameter><link linkend="GtkTreeListRow"><type>GtkTreeListRow</type></link> *list_row</parameter>);</programlisting>
<para>Sets the tree list row that this expander should manage.</para>
<refsect3 id="gtk-tree-expander-set-list-row.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeExpander"><type>GtkTreeExpander</type></link> widget</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>list_row</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeListRow"><type>GtkTreeListRow</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkTreeExpander.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkTreeExpander--child" role="property"><title>The <literal>“child”</literal> property</title>
<indexterm zone="GtkTreeExpander--child"><primary>GtkTreeExpander:child</primary></indexterm>
<programlisting>  “child”                    <link linkend="GtkWidget"><type>GtkWidget</type></link>&#160;*</programlisting>
<para>The child widget with the actual contents</para>
<para>Owner: GtkTreeExpander</para>
<para>Flags: Read / Write</para>
</refsect2>
<refsect2 id="GtkTreeExpander--item" role="property"><title>The <literal>“item”</literal> property</title>
<indexterm zone="GtkTreeExpander--item"><primary>GtkTreeExpander:item</primary></indexterm>
<programlisting>  “item”                     <link linkend="GObject"><type>GObject</type></link>&#160;*</programlisting>
<para>The item held by this expander's row</para>
<para>Owner: GtkTreeExpander</para>
<para>Flags: Read</para>
</refsect2>
<refsect2 id="GtkTreeExpander--list-row" role="property"><title>The <literal>“list-row”</literal> property</title>
<indexterm zone="GtkTreeExpander--list-row"><primary>GtkTreeExpander:list-row</primary></indexterm>
<programlisting>  “list-row”                 <link linkend="GtkTreeListRow"><type>GtkTreeListRow</type></link>&#160;*</programlisting>
<para>The list row to track for expander state</para>
<para>Owner: GtkTreeExpander</para>
<para>Flags: Read / Write</para>
</refsect2>

</refsect1>
<refsect1 id="GtkTreeExpander.action-details" role="action_details">
<title role="action_details.title">Action Details</title>
<refsect2 id="GtkTreeExpander|listitem.toggle-expand" role="action"><title>The <literal>“listitem.toggle-expand”</literal> action</title>
<indexterm zone="GtkTreeExpander|listitem.toggle-expand"><primary>GtkTreeExpander|listitem.toggle-expand</primary></indexterm>
<para>Tries to expand the expander if it was collapsed or collapses it if
it was expanded.</para>
</refsect2>
<refsect2 id="GtkTreeExpander|listitem.collapse" role="action"><title>The <literal>“listitem.collapse”</literal> action</title>
<indexterm zone="GtkTreeExpander|listitem.collapse"><primary>GtkTreeExpander|listitem.collapse</primary></indexterm>
<para>Collapses the expander.</para>
</refsect2>
<refsect2 id="GtkTreeExpander|listitem.expand" role="action"><title>The <literal>“listitem.expand”</literal> action</title>
<indexterm zone="GtkTreeExpander|listitem.expand"><primary>GtkTreeExpander|listitem.expand</primary></indexterm>
<para>Expands the expander if it can be expanded.</para>
</refsect2>

</refsect1>
<refsect1 id="GtkTreeExpander.see-also">
<title>See Also</title>
<para><link linkend="GtkTreeListModel"><type>GtkTreeListModel</type></link></para>

</refsect1>

</refentry>
