<?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-gtktoggleaction">
  <refnamediv>
    <refname>gtk.ToggleAction</refname> <refpurpose>an action which can be
    toggled between two states (new in PyGTK 2.4)</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.ToggleAction</classname></ooclass>
      <ooclass><classname><link linkend="class-gtkaction">gtk.Action</link></classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link linkend="constructor-gtktoggleaction">gtk.ToggleAction</link></methodname>
	<methodparam><parameter role="keyword">name</parameter></methodparam>
	<methodparam><parameter role="keyword">label</parameter></methodparam>
	<methodparam><parameter role="keyword">tooltip</parameter></methodparam>
	<methodparam><parameter role="keyword">stock_id</parameter></methodparam>
      </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktoggleaction--toggled">toggled</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktoggleaction--set-active">set_active</link></methodname>
	<methodparam><parameter role="keyword">is_active</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktoggleaction--get-active">get_active</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktoggleaction--set-draw-as-radio">set_draw_as_radio</link></methodname>
	<methodparam><parameter role="keyword">draw_as_radio</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktoggleaction--get-draw-as-radio">get_draw_as_radio</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gtkaction">gtk.Action</link>
    +-- <link linkend="class-gtktoggleaction">gtk.ToggleAction</link>
</synopsis>

  </refsect1>
  
  <refsect1>
		<title>Implemented Interfaces</title>
		<para>
			<link linkend="class-gtktoggleaction"><classname>gtk.ToggleAction</classname></link>
			implements 
			<link linkend="class-gtkbuildable"><classname>gtk.Buildable</classname></link>
		</para>
	</refsect1>


  <refsect1 id="properties-gtktoggleaction">
    <title>gtk.ToggleAction Properties</title>

    <para><link linkend="properties-gtkaction">gtk.Action 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="4in"/>
	  <tbody>

        <row valign="top">
          <entry>"active"</entry>
          <entry>Read-Write</entry>
          <entry>If the toggle action should be active in or not.  This
          property is available in GTK+ 2.10 and above.</entry>
        </row>

	    <row valign="top">
	      <entry>"draw-as-radio"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, the proxies for this action
	      look like radio action proxies. Available in GTK+ 2.4 and
	      above.</entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1 id="signal-prototypes-gtktoggleaction">
    <title>gtk.ToggleAction Signal Prototypes</title>

    <para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkaction">gtk.Action Signal Prototypes</link></para>

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

  </refsect1>

  <refsect1>
    <title>Description</title>

    <note>
      <para>This object is available in PyGTK 2.4 and above.</para>
    </note>

    <para>A <link
linkend="class-gtktoggleaction"><classname>gtk.ToggleAction</classname></link>
which is a subclass of <link
linkend="class-gtkaction"><classname>gtk.Action</classname></link>
corresponds roughly to a <link
linkend="class-gtkcheckmenuitem"><classname>gtk.CheckMenuItem</classname></link>. It
has an "active" state specifying whether the action has been checked or
not.</para>

  </refsect1>

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

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.ToggleAction</methodname>
	<methodparam><parameter role="keyword">name</parameter></methodparam>
	<methodparam><parameter role="keyword">label</parameter></methodparam>
	<methodparam><parameter role="keyword">tooltip</parameter></methodparam>
	<methodparam><parameter role="keyword">stock_id</parameter></methodparam>
      </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><parameter role="keyword">name</parameter>&nbsp;:</term>
	<listitem><simpara>a unique name for the action</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">label</parameter>&nbsp;:</term>
	<listitem><simpara>the label displayed in menu items and on
buttons</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">tooltip</parameter>&nbsp;:</term>
	<listitem><simpara>a tooltip for the action</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">stock_id</parameter>&nbsp;:</term>
	<listitem><simpara>the stock icon to display in widgets representing
the action</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>a new <link
linkend="class-gtktoggleaction"><classname>gtk.ToggleAction</classname></link></simpara></listitem>
      </varlistentry>
    </variablelist>

    <note>
      <para>This constructor is available in PyGTK 2.4 and above.</para>
    </note>

    <para>Creates a new <link
linkend="class-gtktoggleaction"><classname>gtk.ToggleAction</classname></link>
object. To add the action to a <link
linkend="class-gtkactiongroup"><classname>gtk.ActionGroup</classname></link>
and set the accelerator for the action, call the <link
linkend="method-gtkactiongroup--add-action-with-accel"><methodname>gtk.ActionGroup.add_action_with_accel()</methodname></link>
method.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtktoggleaction--toggled">
      <title>gtk.ToggleAction.toggled</title>

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

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

      <para>The <methodname>toggled</methodname>() method emits the
"toggled" signal on the toggle action.</para>

    </refsect2>

    <refsect2 id="method-gtktoggleaction--set-active">
      <title>gtk.ToggleAction.set_active</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_active</methodname>
	  <methodparam><parameter role="keyword">is_active</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
	  role="keyword">is_active</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> the action should be
	  checked</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>set_active</methodname>() method sets the
checked state on the toggle action.</para>

    </refsect2>

    <refsect2 id="method-gtktoggleaction--get-active">
      <title>gtk.ToggleAction.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 toggle action is
	  checked</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>get_active</methodname>() method returns
<literal>True</literal> if the toggle action is checked.</para>

    </refsect2>

    <refsect2 id="method-gtktoggleaction--set-draw-as-radio">
      <title>gtk.ToggleAction.set_draw_as_radio</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_draw_as_radio</methodname>
	  <methodparam><parameter role="keyword">draw_as_radio</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
	  role="keyword">draw_as_radio</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> the action should
	  have proxies like a radio action</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>set_draw_as_radio</methodname>() method sets the
"draw-as-radio" property to the value of
<parameter>draw_as_radio</parameter>. If
<parameter>draw_as_radio</parameter> is <literal>True</literal> the action
should have proxies like a radio action.</para>

    </refsect2>

    <refsect2 id="method-gtktoggleaction--get-draw-as-radio">
      <title>gtk.ToggleAction.get_draw_as_radio</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_draw_as_radio</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the action should
	  have proxies like a radio action.</simpara></listitem>
	</varlistentry>
      </variablelist>

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

      <para>The <methodname>get_draw_as_radio</methodname>() method returns
the value of the "draw-as-radio" property. If "draw-as-radio" is
<literal>True</literal> the action should have proxies like a radio
action.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Signals</title>

    <refsect2 id="signal-gtktoggleaction--toggled">
      <title>The "toggled" gtk.ToggleAction Signal</title>

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

      <variablelist>
	<varlistentry>
	  <term><parameter>toggleaction</parameter>&nbsp;:</term>
	  <listitem><simpara>the toggleaction that received the
signal</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>

      <note>
	<para>This signal is available in GTK+ 2.4 and above.</para>
      </note>

      <para>The "toggled" signal is emitted when the toggle action changes
its active state.</para>

    </refsect2>

  </refsect1>

</refentry>
