<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="class-gtkcellrenderertoggle">
  <refnamediv>
    <refname>gtk.CellRendererToggle</refname>
    <refpurpose>an object that renders a toggle button into a TreeView
cell</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.CellRendererToggle</classname></ooclass>
      <ooclass><classname><link linkend="class-gtkcellrenderer">gtk.CellRenderer</link></classname></ooclass>
      <constructorsynopsis language="python">
        <methodname><link linkend="constructor-gtkcellrenderertoggle">gtk.CellRendererToggle</link></methodname>
        <methodparam></methodparam>
      </constructorsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkcellrenderertoggle--get-radio">get_radio</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkcellrenderertoggle--set-radio">set_radio</link></methodname>
        <methodparam><parameter role="keyword">radio</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkcellrenderertoggle--get-active">get_active</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkcellrenderertoggle--set-active">set_active</link></methodname>
        <methodparam><parameter role="keyword">setting</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkcellrenderertoggle--get-activatable">get_activatable</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkcellrenderertoggle--set-activatable">set_activatable</link></methodname>
        <methodparam><parameter role="keyword">setting</parameter></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gtkobject">gtk.Object</link>
    +-- <link linkend="class-gtkcellrenderer">gtk.CellRenderer</link>
      +-- <link linkend="class-gtkcellrenderertoggle">gtk.CellRendererToggle</link>
</synopsis>

  </refsect1>

  <refsect1 id="properties-gtkcellrenderertoggle">
    <title>gtk.CellRendererToggle Properties</title>

    <para><link linkend="properties-gtkobject">gtk.Object Properties</link></para>
    <para><link linkend="properties-gtkcellrenderer">gtk.CellRenderer Properties</link></para>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
        <tgroup cols="3">
          <colspec column="1" colwidth="1in"/>
          <colspec column="2" colwidth="1in"/>
          <colspec column="3" colwidth="3.5in"/>
          <tbody>
            <row valign="top">
              <entry>"activatable"</entry>
              <entry>Read/Write</entry>
              <entry>If <literal>True</literal>, the toggle button can be activated</entry>
          </row>

          <row valign="top">
            <entry>"active"</entry>
            <entry>Read/Write</entry>
            <entry>If <literal>True</literal>, the button is active.</entry>
          </row>

          <row valign="top">
            <entry>"inconsistent"</entry>
            <entry>Read/Write</entry>
            <entry>If <literal>True</literal>, the button is in an inconsistent state. GTK+ 2.2 and above.</entry>
          </row>

          <row valign="top">
            <entry>"indicator-size"</entry>
            <entry>Read-Write</entry>
            <entry>Size of check or radio indicator. Allowed values: >= 0. Default value: 12.</entry>
          </row>

          <row valign="top">
            <entry>"radio"</entry>
            <entry>Read/Write</entry>
            <entry>If <literal>True</literal>, draw the toggle button as a radio button</entry>
          </row>
        </tbody>
      </tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1 id="signal-prototypes-gtkcellrenderertoggle">
    <title>gtk.CellRendererToggle Signal Prototypes</title>

    <para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkobject">gtk.Object Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkcellrenderer">gtk.CellRenderer Signal Prototypes</link></para>

    <variablelist>
      <varlistentry>
        <term>"<link linkend="signal-gtkcellrenderertoggle--toggled">toggled</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>cellrenderertoggle</parameter> </methodparam>
            <methodparam><parameter>path</parameter> </methodparam>
            <methodparam><parameter>user_param1</parameter> </methodparam>
            <methodparam><parameter>...</parameter> </methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
    </variablelist>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>The <link linkend="class-gtkcellrenderertoggle"><classname>gtk.CellRendererToggle</classname></link>
    manages the rendering of toggle button into a <link linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>
    cell. The button is drawn as a radio- or checkbutton, depending on the
    "radio" property. When activated, it emits the toggled signal.</para>

  </refsect1>

  <refsect1 id="constructor-gtkcellrenderertoggle">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
      <methodname>gtk.CellRendererToggle</methodname>
      <methodparam></methodparam>
    </constructorsynopsis></programlisting>

    <variablelist>
      <varlistentry>
        <term><emphasis>Returns</emphasis>&nbsp;:</term>
        <listitem><simpara>the new cell renderer</simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new <link linkend="class-gtkcellrenderertoggle"><classname>gtk.CellRendererToggle</classname></link>. 
    The toggle button rendering parameters are adjusted using the object
    properties. The object properties can be set globally (with <link
    linkend="method-gobject--set-property"><methodname>set_property</methodname>()</link>). 
    Also, with <link
    linkend="class-gtktreeviewcolumn"><classname>gtk.TreeViewColumn</classname></link>, 
    you can bind a property to a value in a <link
    linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></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>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtkcellrenderertoggle--get-radio">
      <title>gtk.CellRendererToggle.get_radio</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_radio</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if we're rendering radio toggles rather than checkboxes</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The <methodname>get_radio</methodname>() method returns
      <literal>True</literal> if radio toggles rather than checkboxes are being
      rendered.</para>

    </refsect2>

    <refsect2 id="method-gtkcellrenderertoggle--set-radio">
      <title>gtk.CellRendererToggle.set_radio</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_radio</methodname>
        <methodparam><parameter role="keyword">radio</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">radio</parameter>&nbsp;:</term>
          <listitem><simpara>If <literal>True</literal> make the toggle look like a radio button</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The <methodname>set_radio</methodname>() method sets the style
      of the toggle button. If <parameter>radio</parameter> is
      <literal>True</literal>, the cell renderer renders a radio toggle (i.e. a
      toggle in a group of mutually-exclusive toggles). If
      <literal>False</literal>, 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="class-gtktreeview"><classname>gtk.TreeView</classname></link>, you
      set up a per-row setting using <link
      linkend="class-gtktreeviewcolumn"><classname>gtk.TreeViewColumn</classname></link> 
      to associate model columns with cell renderer properties).</para>

    </refsect2>

    <refsect2 id="method-gtkcellrenderertoggle--get-active">
      <title>gtk.CellRendererToggle.get_active</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_active</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if the cell renderer is active.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The <methodname>get_active</methodname>() method returns
      <literal>True</literal> if the cell renderer is active. See <link
      linkend="method-gtkcellrenderertoggle--set-active"><function>gtk.CellRendererToggle.set_active()</function></link>.</para>

    </refsect2>

    <refsect2 id="method-gtkcellrenderertoggle--set-active">
      <title>gtk.CellRendererToggle.set_active</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_active</methodname>
        <methodparam><parameter role="keyword">setting</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">setting</parameter>&nbsp;:</term>
          <listitem><simpara>the value to set.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The <methodname>set_active</methodname>() method activates a
      cell renderer if <parameter>setting</parameter> is <literal>True</literal>
      and or deactivates a cell renderer if <parameter>setting</parameter> is
      <literal>False</literal>.</para>

    </refsect2>

    <refsect2 id="method-gtkcellrenderertoggle--get-activatable">
      <title>gtk.CellRendererToggle.get_activatable</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_activatable</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if the cell renderer is activatable.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.22 and above.</para>
      </note>

      <para>The <methodname>get_activatable</methodname>() method returns
      <literal>True</literal> if the cell renderer is activatable.</para>

    </refsect2>

    <refsect2 id="method-gtkcellrenderertoggle--set-activatable">
      <title>gtk.CellRendererToggle.set_activatable</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_activatable</methodname>
        <methodparam><parameter role="keyword">setting</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">setting</parameter>&nbsp;:</term>
          <listitem><simpara>the value to set.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.22 and above.</para>
      </note>

      <para>The <methodname>set_activatable</methodname>() method sets wether
      the cell renderer is activatable.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Signals</title>

    <refsect2 id="signal-gtkcellrenderertoggle--toggled">
      <title>The "toggled" gtk.CellRendererToggle Signal</title>

      <programlisting><methodsynopsis language="python">
        <methodname>callback</methodname>
        <methodparam><parameter>cellrenderertoggle</parameter></methodparam>
        <methodparam><parameter>path</parameter></methodparam>
        <methodparam><parameter>user_param1</parameter></methodparam>
        <methodparam><parameter>...</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>cellrenderertoggle</parameter>&nbsp;:</term>
          <listitem><simpara>the cellrenderertoggle that received the "toggled" signal</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>path</parameter>&nbsp;:</term>
          <listitem><simpara>the path of the cellrenderertoggle represented as a string</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified with the <link linkend="method-gobject--connect"><methodname>connect</methodname>()</link> method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The "toggled" signal is emitted when the toggle button in the
      cell changes state.</para>

    </refsect2>

  </refsect1>

</refentry>
