<?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-gtkimagemenuitem">
  <refnamediv>
    <refname>gtk.ImageMenuItem</refname>
    <refpurpose>a menuitem that displays an image with an accel
label</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.ImageMenuItem</classname></ooclass>
      <ooclass><classname><link
linkend="class-gtkmenuitem">gtk.MenuItem</link></classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
linkend="constructor-gtkimagemenuitem">gtk.ImageMenuItem</link></methodname>
	<methodparam><parameter
		       role="keyword">stock_id</parameter><initializer>None</initializer></methodparam>
	<methodparam><parameter
		       role="keyword">accel_group</parameter><initializer>None</initializer></methodparam>
      </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkimagemenuitem--set-image">set_image</link></methodname>
	<methodparam><parameter
		       role="keyword">image</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtkimagemenuitem--get-image">get_image</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>

      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkimagemenuitem--set-always-show-image">set_always_show_image</link></methodname>
        <methodparam><parameter role="keyword">always_show</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkimagemenuitem--get-always-show-image">get_always_show_image</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkimagemenuitem--set-use-stock">set_use_stock</link></methodname>
        <methodparam><parameter role="keyword">use_stock</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkimagemenuitem--get-use-stock">get_use_stock</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkimagemenuitem--set-accel-group">set_accel_group</link></methodname>
        <methodparam><parameter role="keyword">accel_group</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-gtkwidget">gtk.Widget</link>
      +-- <link linkend="class-gtkcontainer">gtk.Container</link>
        +-- <link linkend="class-gtkbin">gtk.Bin</link>
          +-- <link linkend="class-gtkitem">gtk.Item</link>
            +-- <link linkend="class-gtkmenuitem">gtk.MenuItem</link>
              +-- <link linkend="class-gtkimagemenuitem">gtk.ImageMenuItem</link>
</synopsis>

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

  <refsect1 id="properties-gtkimagemenuitem">
    <title>gtk.ImageMenuItem Properties</title>

    <para><link linkend="properties-gtkobject">gtk.Object Properties</link></para>
    <para><link linkend="properties-gtkwidget">gtk.Widget Properties</link></para>
    <para><link linkend="properties-gtkcontainer">gtk.Container 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>"accel-group"</entry>
	      <entry>Write</entry>
	      <entry>The Accel Group to use for stock accelerator keys.
Available in GTK+ 2.16 and above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"always-show-image"</entry>
	      <entry>Read-Write-Construct</entry>
	      <entry>If <literal>True</literal>, the menu item will ignore the "gtk-menu-images" setting
        and always show the image, if available. Use this property if the menuitem would be useless
        or hard to use without the image.
Default value: <literal>False</literal>.
Available in GTK+ 2.16 and above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"image"</entry>
	      <entry>Read-Write</entry>
	      <entry>the child widget that is next to the text in the menu item</entry>
	    </row>

	    <row valign="top">
	      <entry>"use-stock"</entry>
	      <entry>Read-Write-Construct</entry>
	      <entry>If <literal>True</literal>, the label set in the menuitem is used as a stock id
        to select the stock item for the item.
Default value: <literal>False</literal>.
Available in GTK+ 2.16 and above.</entry>
	    </row>

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

  </refsect1>

  <refsect1 id="style-properties-gtkimagemenuitem">
    <title>gtk.ImageMenuItem Style Properties</title>

    <para><link linkend="style-properties-gtkwidget">gtk.Widget Style Properties</link></para>
    <para><link linkend="style-properties-gtkmenuitem">gtk.MenuItem Style Properties</link></para>

  </refsect1>

  <refsect1 id="signal-prototypes-gtkimagemenuitem">
    <title>gtk.ImageMenuItem 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-gtkwidget">gtk.Widget Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkcontainer">gtk.Container Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkitem">gtk.Item Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkmenuitem">gtk.MenuItem Signal Prototypes</link></para>
  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>The <link
linkend="class-gtkimagemenuitem"><classname>gtk.ImageMenuItem</classname></link> 
widget is a subclass of <link
linkend="class-gtkmenuitem"><classname>gtk.MenuItem</classname></link> that
contains an image widget and a <link
linkend="class-gtkaccellabel"><classname>gtk.AccelLabel</classname></link>
though a <link
linkend="class-gtkimagemenuitem"><classname>gtk.ImageMenuItem</classname></link> 
can be created that has no image and an empty label.</para>

  </refsect1>

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

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.ImageMenuItem</methodname>
	<methodparam><parameter
		       role="keyword">stock_id</parameter><initializer>None</initializer></methodparam>
	<methodparam><parameter
		       role="keyword">accel_group</parameter><initializer>None</initializer></methodparam>
      </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><parameter role="keyword">stock_id</parameter>&nbsp;:</term>
	<listitem><simpara>the stock icon ID or <literal>None</literal> if
no image is needed</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter
role="keyword">accel_group</parameter>&nbsp;:</term>
	<listitem><simpara>the accel group to add the accel label mnemonic
to</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>a new <link
linkend="class-gtkimagemenuitem"><classname>gtk.ImageMenuItem</classname></link> 
widget</simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new <link
linkend="class-gtkimagemenuitem"><classname>gtk.ImageMenuItem</classname></link> 
with a stock label and image specified by <parameter>stock_id</parameter>.
If <parameter>stock_id</parameter> is not a stock item then the image will
be the "broken image" and the label text will be the string in
<parameter>stock_id</parameter>. The label text will be parsed for
underscore characters to indicate the mnemonic character for the
accelerator.</para>

    <para>If <parameter>stock_id</parameter> specifies a stock item and
<parameter>accel_group</parameter> specifies a <link
linkend="class-gtkaccelgroup"><classname>gtk.AccelGroup</classname></link>
the accelerator is added to <parameter>accel_group</parameter>.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtkimagemenuitem--set-image">
      <title>gtk.ImageMenuItem.set_image</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_image</methodname>
	  <methodparam><parameter
			 role="keyword">image</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">image</parameter>&nbsp;:</term>
	  <listitem><simpara>a widget to set as the image for the menu
item.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_image</methodname>() method sets the image
of the image menu item to the widget specified in
<parameter>image</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtkimagemenuitem--get-image">
      <title>gtk.ImageMenuItem.get_image</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_image</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the image in the image menu
item</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_image</methodname>() method gets the widget
that is currently set as the image of image menu item. See <link
linkend="method-gtkimagemenuitem--set-image"><methodname>set_image</methodname>()</link>.</para>

    </refsect2>

    <refsect2 id="method-gtkimagemenuitem--set-always-show-image">
      <title>gtk.ImageMenuItem.set_always_show_image</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_always_show_image</methodname>
        <methodparam><parameter role="keyword">always_show</parameter></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">always_show</parameter>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if the menuitem should always show the image, <literal>False</literal> otherwise.</simpara></listitem>
        </varlistentry>
      </variablelist>

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

      <para>The <methodname>set_always_show_image</methodname>() method sets whether
      the menu item will ignore the "gtk-menu-images" setting and always show the image,
      if available.</para>

    </refsect2>

    <refsect2 id="method-gtkimagemenuitem--get-always-show-image">
      <title>gtk.ImageMenuItem.get_always_show_image</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_always_show_image</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if the menuitem will always show the image, <literal>False</literal> otherwise..</simpara></listitem>
        </varlistentry>
      </variablelist>

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

      <para>The <methodname>get_always_show_image</methodname>() method returns whether
      the menu item will ignore the "gtk-menu-images" setting and always show the image,
      if available.</para>

    </refsect2>

    <refsect2 id="method-gtkimagemenuitem--set-use-stock">
      <title>gtk.ImageMenuItem.set_use_stock</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_use_stock</methodname>
        <methodparam><parameter role="keyword">use_stock</parameter></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">use_stock</parameter>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if the menuitem should use a stock item, <literal>False</literal> otherwise.</simpara></listitem>
        </varlistentry>
      </variablelist>

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

      <para>The <methodname>set_use_stock</methodname>() method sets whether
      the label set in the menuitem is used as a stock id to select the stock
      item for the item.</para>

    </refsect2>

    <refsect2 id="method-gtkimagemenuitem--get-use-stock">
      <title>gtk.ImageMenuItem.get_use_stock</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_use_stock</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if the menuitem will use a stock item, <literal>False</literal> otherwise.</simpara></listitem>
        </varlistentry>
      </variablelist>

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

      <para>The <methodname>get_use_stock</methodname>() method gets whether
      the label set in the menuitem is used as a stock id to select the stock item for the item.</para>

    </refsect2>

    <refsect2 id="method-gtkimagemenuitem--set-accel-group">
      <title>gtk.ImageMenuItem.set_accel_group</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_accel_group</methodname>
        <methodparam><parameter role="keyword">accel_group</parameter></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">accel_group</parameter>&nbsp;:</term>
          <listitem><simpara>The <link linkend="class-gtkaccelgroup"><classname>gtk.AccelGroup</classname></link>.</simpara></listitem>
        </varlistentry>
      </variablelist>

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

      <para>The <methodname>set_accel_group</methodname>() method specifies an accel_group to add the menu items accelerator to (this only
      applies to stock items so a stock item must already be set, make sure to call
      <link linkend="method-gtkimage-menu-item--set-use-stock"><methodname>get_accel_width</methodname></link>
      gtk_image_menu_item_set_use_stock()
      and gtk_menu_item_set_label()
      with a valid stock item first).</para>

      <para>If you want this menu item to have changeable accelerators then you shouldnt need this (see
      gtk_image_menu_item_new_from_stock()).</para>

    </refsect2>

  </refsect1>

</refentry>
