<?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 index-Objects-Grouped SYSTEM "objects_grouped.sgml"-->
<refentry id="GtkCellRendererToggle">
<refmeta>
<refentrytitle role="top_of_page" id="GtkCellRendererToggle.top_of_page">GtkCellRendererToggle</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkCellRendererToggle</refname>
<refpurpose>Renders a toggle button in a cell</refpurpose>
</refnamediv>

<refsynopsisdiv id="GtkCellRendererToggle.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gtk/gtk.h&gt;

                    <link linkend="GtkCellRendererToggle-struct">GtkCellRendererToggle</link>;
<link linkend="GtkCellRenderer">GtkCellRenderer</link> *   <link linkend="gtk-cell-renderer-toggle-new">gtk_cell_renderer_toggle_new</link>        (void);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-cell-renderer-toggle-get-radio">gtk_cell_renderer_toggle_get_radio</link>  (<link linkend="GtkCellRendererToggle">GtkCellRendererToggle</link> *toggle);
<link linkend="void">void</link>                <link linkend="gtk-cell-renderer-toggle-set-radio">gtk_cell_renderer_toggle_set_radio</link>  (<link linkend="GtkCellRendererToggle">GtkCellRendererToggle</link> *toggle,
                                                         <link linkend="gboolean">gboolean</link> radio);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-cell-renderer-toggle-get-active">gtk_cell_renderer_toggle_get_active</link> (<link linkend="GtkCellRendererToggle">GtkCellRendererToggle</link> *toggle);
<link linkend="void">void</link>                <link linkend="gtk-cell-renderer-toggle-set-active">gtk_cell_renderer_toggle_set_active</link> (<link linkend="GtkCellRendererToggle">GtkCellRendererToggle</link> *toggle,
                                                         <link linkend="gboolean">gboolean</link> setting);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkCellRendererToggle.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
         +----<link linkend="GtkObject">GtkObject</link>
               +----<link linkend="GtkCellRenderer">GtkCellRenderer</link>
                     +----GtkCellRendererToggle
</synopsis>
</refsect1>





<refsect1 id="GtkCellRendererToggle.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkCellRendererToggle--activatable">activatable</link>&quot;              <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkCellRendererToggle--active">active</link>&quot;                   <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkCellRendererToggle--inconsistent">inconsistent</link>&quot;             <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkCellRendererToggle--indicator-size">indicator-size</link>&quot;           <link linkend="gint">gint</link>                  : Read / Write
  &quot;<link linkend="GtkCellRendererToggle--radio">radio</link>&quot;                    <link linkend="gboolean">gboolean</link>              : Read / Write
</synopsis>
</refsect1>

<refsect1 id="GtkCellRendererToggle.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GtkCellRendererToggle-toggled">toggled</link>&quot;                                        : Run Last
</synopsis>
</refsect1>


<refsect1 id="GtkCellRendererToggle.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="GtkCellRendererToggle"><type>GtkCellRendererToggle</type></link> renders a toggle button in a cell. The
button is drawn as a radio- or checkbutton, depending on the
<link linkend="GtkCellRendererToggle--radio">radio</link>
property. When activated, it emits the toggled signal.
</para>
</refsect1>

<refsect1 id="GtkCellRendererToggle.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkCellRendererToggle-struct" role="struct">
<title>GtkCellRendererToggle</title>
<indexterm zone="GtkCellRendererToggle-struct"><primary sortas="CellRendererToggle">GtkCellRendererToggle</primary></indexterm><programlisting>typedef struct _GtkCellRendererToggle GtkCellRendererToggle;</programlisting>
<para>
</para></refsect2>
<refsect2 id="gtk-cell-renderer-toggle-new" role="function">
<title>gtk_cell_renderer_toggle_new ()</title>
<indexterm zone="gtk-cell-renderer-toggle-new"><primary sortas="cell_renderer_toggle_new">gtk_cell_renderer_toggle_new</primary></indexterm><programlisting><link linkend="GtkCellRenderer">GtkCellRenderer</link> *   gtk_cell_renderer_toggle_new        (void);</programlisting>
<para>
Creates a new <link linkend="GtkCellRendererToggle"><type>GtkCellRendererToggle</type></link>. Adjust rendering
parameters 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 "active" property on the cell renderer to a boolean value
in the model, thus causing the check button to reflect the state of
the model.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the new cell renderer
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-cell-renderer-toggle-get-radio" role="function">
<title>gtk_cell_renderer_toggle_get_radio ()</title>
<indexterm zone="gtk-cell-renderer-toggle-get-radio"><primary sortas="cell_renderer_toggle_get_radio">gtk_cell_renderer_toggle_get_radio</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_cell_renderer_toggle_get_radio  (<link linkend="GtkCellRendererToggle">GtkCellRendererToggle</link> *toggle);</programlisting>
<para>
Returns whether we're rendering radio toggles rather than checkboxes.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>toggle</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkCellRendererToggle"><type>GtkCellRendererToggle</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if we're rendering radio toggles rather than checkboxes
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-cell-renderer-toggle-set-radio" role="function">
<title>gtk_cell_renderer_toggle_set_radio ()</title>
<indexterm zone="gtk-cell-renderer-toggle-set-radio"><primary sortas="cell_renderer_toggle_set_radio">gtk_cell_renderer_toggle_set_radio</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_cell_renderer_toggle_set_radio  (<link linkend="GtkCellRendererToggle">GtkCellRendererToggle</link> *toggle,
                                                         <link linkend="gboolean">gboolean</link> radio);</programlisting>
<para>
If <parameter>radio</parameter> is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, the cell renderer renders a radio toggle
(i.e. a toggle in a group of mutually-exclusive toggles).
If <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>, it renders a check toggle (a standalone boolean option).
This can be set globally for the cell renderer, or changed just
before rendering each cell in the model (for <link linkend="GtkTreeView"><type>GtkTreeView</type></link>, you set
up a per-row setting using <link linkend="GtkTreeViewColumn"><type>GtkTreeViewColumn</type></link> to associate model
columns with cell renderer properties).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>toggle</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkCellRendererToggle"><type>GtkCellRendererToggle</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>radio</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> to make the toggle look like a radio button
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-cell-renderer-toggle-get-active" role="function">
<title>gtk_cell_renderer_toggle_get_active ()</title>
<indexterm zone="gtk-cell-renderer-toggle-get-active"><primary sortas="cell_renderer_toggle_get_active">gtk_cell_renderer_toggle_get_active</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_cell_renderer_toggle_get_active (<link linkend="GtkCellRendererToggle">GtkCellRendererToggle</link> *toggle);</programlisting>
<para>
Returns whether the cell renderer is active. See
<link linkend="gtk-cell-renderer-toggle-set-active"><function>gtk_cell_renderer_toggle_set_active()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>toggle</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkCellRendererToggle"><type>GtkCellRendererToggle</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the cell renderer is active.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-cell-renderer-toggle-set-active" role="function">
<title>gtk_cell_renderer_toggle_set_active ()</title>
<indexterm zone="gtk-cell-renderer-toggle-set-active"><primary sortas="cell_renderer_toggle_set_active">gtk_cell_renderer_toggle_set_active</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_cell_renderer_toggle_set_active (<link linkend="GtkCellRendererToggle">GtkCellRendererToggle</link> *toggle,
                                                         <link linkend="gboolean">gboolean</link> setting);</programlisting>
<para>
Activates or deactivates a cell renderer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>toggle</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkCellRendererToggle"><type>GtkCellRendererToggle</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>setting</parameter>&#160;:</term>
<listitem><simpara> the value to set.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="GtkCellRendererToggle.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkCellRendererToggle--activatable" role="property"><title>The <literal>&quot;activatable&quot;</literal> property</title>
<indexterm zone="GtkCellRendererToggle--activatable"><primary sortas="CellRendererToggle:activatable">GtkCellRendererToggle:activatable</primary></indexterm><programlisting>  &quot;activatable&quot;              <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>The toggle button can be activated.</para><para>Default value: TRUE</para>
</refsect2>
<refsect2 id="GtkCellRendererToggle--active" role="property"><title>The <literal>&quot;active&quot;</literal> property</title>
<indexterm zone="GtkCellRendererToggle--active"><primary sortas="CellRendererToggle:active">GtkCellRendererToggle:active</primary></indexterm><programlisting>  &quot;active&quot;                   <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>The toggle state of the button.</para><para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkCellRendererToggle--inconsistent" role="property"><title>The <literal>&quot;inconsistent&quot;</literal> property</title>
<indexterm zone="GtkCellRendererToggle--inconsistent"><primary sortas="CellRendererToggle:inconsistent">GtkCellRendererToggle:inconsistent</primary></indexterm><programlisting>  &quot;inconsistent&quot;             <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>The inconsistent state of the button.</para><para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkCellRendererToggle--indicator-size" role="property"><title>The <literal>&quot;indicator-size&quot;</literal> property</title>
<indexterm zone="GtkCellRendererToggle--indicator-size"><primary sortas="CellRendererToggle:indicator-size">GtkCellRendererToggle:indicator-size</primary></indexterm><programlisting>  &quot;indicator-size&quot;           <link linkend="gint">gint</link>                  : Read / Write</programlisting>
<para>Size of check or radio indicator.</para><para>Allowed values: &gt;= 0</para>
<para>Default value: 13</para>
</refsect2>
<refsect2 id="GtkCellRendererToggle--radio" role="property"><title>The <literal>&quot;radio&quot;</literal> property</title>
<indexterm zone="GtkCellRendererToggle--radio"><primary sortas="CellRendererToggle:radio">GtkCellRendererToggle:radio</primary></indexterm><programlisting>  &quot;radio&quot;                    <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>Draw the toggle button as a radio button.</para><para>Default value: FALSE</para>
</refsect2>
</refsect1>

<refsect1 id="GtkCellRendererToggle.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkCellRendererToggle-toggled" role="signal"><title>The <literal>&quot;toggled&quot;</literal> signal</title>
<indexterm zone="GtkCellRendererToggle-toggled"><primary sortas="CellRendererToggle::toggled">GtkCellRendererToggle::toggled</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkCellRendererToggle">GtkCellRendererToggle</link> *cell_renderer,
                                                        <link linkend="gchar">gchar</link>                 *path,
                                                        <link linkend="gpointer">gpointer</link>               user_data)          : Run Last</programlisting>
<para>
The ::toggled signal is emitted when the cell is toggled.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>cell_renderer</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>path</parameter>&#160;:</term>
<listitem><simpara> string representation of <link linkend="GtkTreePath"><type>GtkTreePath</type></link> describing the
       event location
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>



</refentry>
