<?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="GtkMenuItem">
<refmeta>
<refentrytitle role="top_of_page" id="GtkMenuItem.top_of_page">GtkMenuItem</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkMenuItem</refname>
<refpurpose>The widget used for item in menus</refpurpose>
</refnamediv>

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

<synopsis>

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

                    <link linkend="GtkMenuItem-struct">GtkMenuItem</link>;
<link linkend="GtkWidget">GtkWidget</link>*          <link linkend="gtk-menu-item-new">gtk_menu_item_new</link>                   (void);
<link linkend="GtkWidget">GtkWidget</link>*          <link linkend="gtk-menu-item-new-with-label">gtk_menu_item_new_with_label</link>        (const <link linkend="gchar">gchar</link> *label);
<link linkend="GtkWidget">GtkWidget</link>*          <link linkend="gtk-menu-item-new-with-mnemonic">gtk_menu_item_new_with_mnemonic</link>     (const <link linkend="gchar">gchar</link> *label);
<link linkend="void">void</link>                <link linkend="gtk-menu-item-set-right-justified">gtk_menu_item_set_right_justified</link>   (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         <link linkend="gboolean">gboolean</link> right_justified);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-menu-item-get-right-justified">gtk_menu_item_get_right_justified</link>   (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);
const <link linkend="gchar">gchar</link> *       <link linkend="gtk-menu-item-get-label">gtk_menu_item_get_label</link>             (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);
<link linkend="void">void</link>                <link linkend="gtk-menu-item-set-label">gtk_menu_item_set_label</link>             (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         const <link linkend="gchar">gchar</link> *label);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-menu-item-get-use-underline">gtk_menu_item_get_use_underline</link>     (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);
<link linkend="void">void</link>                <link linkend="gtk-menu-item-set-use-underline">gtk_menu_item_set_use_underline</link>     (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         <link linkend="gboolean">gboolean</link> setting);
<link linkend="void">void</link>                <link linkend="gtk-menu-item-set-submenu">gtk_menu_item_set_submenu</link>           (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         <link linkend="GtkWidget">GtkWidget</link> *submenu);
<link linkend="GtkWidget">GtkWidget</link>*          <link linkend="gtk-menu-item-get-submenu">gtk_menu_item_get_submenu</link>           (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);
<link linkend="void">void</link>                <link linkend="gtk-menu-item-remove-submenu">gtk_menu_item_remove_submenu</link>        (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);
<link linkend="void">void</link>                <link linkend="gtk-menu-item-set-accel-path">gtk_menu_item_set_accel_path</link>        (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         const <link linkend="gchar">gchar</link> *accel_path);
const <link linkend="gchar">gchar</link>*        <link linkend="gtk-menu-item-get-accel-path">gtk_menu_item_get_accel_path</link>        (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);
<link linkend="void">void</link>                <link linkend="gtk-menu-item-select">gtk_menu_item_select</link>                (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);
<link linkend="void">void</link>                <link linkend="gtk-menu-item-deselect">gtk_menu_item_deselect</link>              (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);
<link linkend="void">void</link>                <link linkend="gtk-menu-item-activate">gtk_menu_item_activate</link>              (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);
<link linkend="void">void</link>                <link linkend="gtk-menu-item-toggle-size-request">gtk_menu_item_toggle_size_request</link>   (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         <link linkend="gint">gint</link> *requisition);
<link linkend="void">void</link>                <link linkend="gtk-menu-item-toggle-size-allocate">gtk_menu_item_toggle_size_allocate</link>  (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         <link linkend="gint">gint</link> allocation);
#define             <link linkend="gtk-menu-item-right-justify">gtk_menu_item_right_justify</link>         (menu_item)
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkMenuItem.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="GtkWidget">GtkWidget</link>
                     +----<link linkend="GtkContainer">GtkContainer</link>
                           +----<link linkend="GtkBin">GtkBin</link>
                                 +----<link linkend="GtkItem">GtkItem</link>
                                       +----GtkMenuItem
                                             +----<link linkend="GtkCheckMenuItem">GtkCheckMenuItem</link>
                                             +----<link linkend="GtkImageMenuItem">GtkImageMenuItem</link>
                                             +----<link linkend="GtkSeparatorMenuItem">GtkSeparatorMenuItem</link>
                                             +----<link linkend="GtkTearoffMenuItem">GtkTearoffMenuItem</link>
</synopsis>
</refsect1>



<refsect1 id="GtkMenuItem.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkMenuItem implements
 <link linkend="GtkActivatable">GtkActivatable</link>,  <link linkend="AtkImplementorIface">AtkImplementorIface</link> and  <link linkend="GtkBuildable">GtkBuildable</link>.</para>
</refsect1>


<refsect1 id="GtkMenuItem.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkMenuItem--accel-path">accel-path</link>&quot;               <link linkend="gchar">gchar</link>*                : Read / Write
  &quot;<link linkend="GtkMenuItem--label">label</link>&quot;                    <link linkend="gchar">gchar</link>*                : Read / Write
  &quot;<link linkend="GtkMenuItem--right-justified">right-justified</link>&quot;          <link linkend="gboolean">gboolean</link>              : Read / Write
  &quot;<link linkend="GtkMenuItem--submenu">submenu</link>&quot;                  <link linkend="GtkMenu">GtkMenu</link>*              : Read / Write
  &quot;<link linkend="GtkMenuItem--use-underline">use-underline</link>&quot;            <link linkend="gboolean">gboolean</link>              : Read / Write
</synopsis>
</refsect1>
<refsect1 id="GtkMenuItem.style-properties" role="style_properties">
<title role="style_properties.title">Style Properties</title>
<synopsis>
  &quot;<link linkend="GtkMenuItem--s-arrow-scaling">arrow-scaling</link>&quot;            <link linkend="gfloat">gfloat</link>                : Read
  &quot;<link linkend="GtkMenuItem--s-arrow-spacing">arrow-spacing</link>&quot;            <link linkend="gint">gint</link>                  : Read
  &quot;<link linkend="GtkMenuItem--s-horizontal-padding">horizontal-padding</link>&quot;       <link linkend="gint">gint</link>                  : Read
  &quot;<link linkend="GtkMenuItem--s-selected-shadow-type">selected-shadow-type</link>&quot;     <link linkend="GtkShadowType">GtkShadowType</link>         : Read
  &quot;<link linkend="GtkMenuItem--s-toggle-spacing">toggle-spacing</link>&quot;           <link linkend="gint">gint</link>                  : Read
  &quot;<link linkend="GtkMenuItem--s-width-chars">width-chars</link>&quot;              <link linkend="gint">gint</link>                  : Read
</synopsis>
</refsect1>

<refsect1 id="GtkMenuItem.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GtkMenuItem-activate">activate</link>&quot;                                       : Run First / Action
  &quot;<link linkend="GtkMenuItem-activate-item">activate-item</link>&quot;                                  : Run First
  &quot;<link linkend="GtkMenuItem-toggle-size-allocate">toggle-size-allocate</link>&quot;                           : Run First
  &quot;<link linkend="GtkMenuItem-toggle-size-request">toggle-size-request</link>&quot;                            : Run First
</synopsis>
</refsect1>


<refsect1 id="GtkMenuItem.description" role="desc">
<title role="desc.title">Description</title>
<para>
The <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> widget and the derived widgets are the only valid
childs for menus. Their function is to correctly handle highlighting,
alignment, events and submenus.
</para>
<para>
As it derives from <link linkend="GtkBin"><type>GtkBin</type></link> it can hold any valid child widget, altough
only a few are really useful.
</para>
<refsect2 id="GtkMenuItem-BUILDER-UI">
<title>GtkMenuItem as GtkBuildable</title>
<para>
The GtkMenuItem implementation of the GtkBuildable interface
supports adding a submenu by specifying "submenu" as the "type"
attribute of a &lt;child&gt; element.
</para>
<example>
<title>A UI definition fragment with submenus</title>
<programlisting><![CDATA[
<object class="GtkMenuItem">
  <child type="submenu">
    <object class="GtkMenu"/>
  </child>
</object>
]]></programlisting>
</example>
</refsect2>
</refsect1>

<refsect1 id="GtkMenuItem.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkMenuItem-struct" role="struct">
<title>GtkMenuItem</title>
<indexterm zone="GtkMenuItem-struct"><primary sortas="MenuItem">GtkMenuItem</primary></indexterm><programlisting>typedef struct _GtkMenuItem GtkMenuItem;</programlisting>
<para>
</para></refsect2>
<refsect2 id="gtk-menu-item-new" role="function">
<title>gtk_menu_item_new ()</title>
<indexterm zone="gtk-menu-item-new"><primary sortas="menu_item_new">gtk_menu_item_new</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>*          gtk_menu_item_new                   (void);</programlisting>
<para>
Creates a new <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>.
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>the newly created <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-new-with-label" role="function">
<title>gtk_menu_item_new_with_label ()</title>
<indexterm zone="gtk-menu-item-new-with-label"><primary sortas="menu_item_new_with_label">gtk_menu_item_new_with_label</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>*          gtk_menu_item_new_with_label        (const <link linkend="gchar">gchar</link> *label);</programlisting>
<para>
Creates a new <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> whose child is a <link linkend="GtkLabel"><type>GtkLabel</type></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>label</parameter>&#160;:</term>
<listitem><simpara>the text for the label
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>the newly created <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-new-with-mnemonic" role="function">
<title>gtk_menu_item_new_with_mnemonic ()</title>
<indexterm zone="gtk-menu-item-new-with-mnemonic"><primary sortas="menu_item_new_with_mnemonic">gtk_menu_item_new_with_mnemonic</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>*          gtk_menu_item_new_with_mnemonic     (const <link linkend="gchar">gchar</link> *label);</programlisting>
<para>
Creates a new <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> containing a label. The label
will be created using <link linkend="gtk-label-new-with-mnemonic"><function>gtk_label_new_with_mnemonic()</function></link>, so underscores
in <parameter>label</parameter> indicate the mnemonic for the menu item.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>label</parameter>&#160;:</term>
<listitem><simpara> The text of the button, with an underscore in front of the
        mnemonic character
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-set-right-justified" role="function">
<title>gtk_menu_item_set_right_justified ()</title>
<indexterm zone="gtk-menu-item-set-right-justified"><primary sortas="menu_item_set_right_justified">gtk_menu_item_set_right_justified</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_item_set_right_justified   (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         <link linkend="gboolean">gboolean</link> right_justified);</programlisting>
<para>
Sets whether the menu item appears justified at the right
side of a menu bar. This was traditionally done for "Help" menu
items, but is now considered a bad idea. (If the widget
layout is reversed for a right-to-left language like Hebrew
or Arabic, right-justified-menu-items appear at the left.)</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>right_justified</parameter>&#160;:</term>
<listitem><simpara> if <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> the menu item will appear at the 
  far right if added to a menu bar.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-get-right-justified" role="function">
<title>gtk_menu_item_get_right_justified ()</title>
<indexterm zone="gtk-menu-item-get-right-justified"><primary sortas="menu_item_get_right_justified">gtk_menu_item_get_right_justified</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_menu_item_get_right_justified   (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);</programlisting>
<para>
Gets whether the menu item appears justified at the right
side of the menu bar.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the menu item will appear at the
  far right if added to a menu bar.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-get-label" role="function" condition="since:2.16">
<title>gtk_menu_item_get_label ()</title>
<indexterm zone="gtk-menu-item-get-label" role="2.16"><primary sortas="menu_item_get_label">gtk_menu_item_get_label</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link> *       gtk_menu_item_get_label             (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);</programlisting>
<para>
Sets <parameter>text</parameter> on the <parameter>menu_item</parameter> label</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The text in the <parameter>menu_item</parameter> label. This is the internal
  string used by the label, and must not be modified.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.16</para></refsect2>
<refsect2 id="gtk-menu-item-set-label" role="function" condition="since:2.16">
<title>gtk_menu_item_set_label ()</title>
<indexterm zone="gtk-menu-item-set-label" role="2.16"><primary sortas="menu_item_set_label">gtk_menu_item_set_label</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_item_set_label             (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         const <link linkend="gchar">gchar</link> *label);</programlisting>
<para>
Sets <parameter>text</parameter> on the <parameter>menu_item</parameter> label</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>label</parameter>&#160;:</term>
<listitem><simpara> the text you want to set
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.16</para></refsect2>
<refsect2 id="gtk-menu-item-get-use-underline" role="function" condition="since:2.16">
<title>gtk_menu_item_get_use_underline ()</title>
<indexterm zone="gtk-menu-item-get-use-underline" role="2.16"><primary sortas="menu_item_get_use_underline">gtk_menu_item_get_use_underline</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_menu_item_get_use_underline     (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);</programlisting>
<para>
Checks if an underline in the text indicates the next character should be
used for the mnemonic accelerator key.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if an embedded underline in the label indicates
              the mnemonic accelerator key.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.16</para></refsect2>
<refsect2 id="gtk-menu-item-set-use-underline" role="function" condition="since:2.16">
<title>gtk_menu_item_set_use_underline ()</title>
<indexterm zone="gtk-menu-item-set-use-underline" role="2.16"><primary sortas="menu_item_set_use_underline">gtk_menu_item_set_use_underline</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_item_set_use_underline     (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         <link linkend="gboolean">gboolean</link> setting);</programlisting>
<para>
If true, an underline in the text indicates the next character should be
used for the mnemonic accelerator key.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>setting</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if underlines in the text indicate mnemonics  
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.16</para></refsect2>
<refsect2 id="gtk-menu-item-set-submenu" role="function">
<title>gtk_menu_item_set_submenu ()</title>
<indexterm zone="gtk-menu-item-set-submenu"><primary sortas="menu_item_set_submenu">gtk_menu_item_set_submenu</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_item_set_submenu           (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         <link linkend="GtkWidget">GtkWidget</link> *submenu);</programlisting>
<para>
Sets or replaces the menu item's submenu, or removes it when a <link linkend="NULL--CAPS"><literal>NULL</literal></link>
submenu is passed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>submenu</parameter>&#160;:</term>
<listitem><simpara> the submenu, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-get-submenu" role="function">
<title>gtk_menu_item_get_submenu ()</title>
<indexterm zone="gtk-menu-item-get-submenu"><primary sortas="menu_item_get_submenu">gtk_menu_item_get_submenu</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>*          gtk_menu_item_get_submenu           (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);</programlisting>
<para>
Gets the submenu underneath this menu item, if any. See
<link linkend="gtk-menu-item-set-submenu"><function>gtk_menu_item_set_submenu()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> submenu for this menu item, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if none.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-remove-submenu" role="function" condition="deprecated">
<title>gtk_menu_item_remove_submenu ()</title>
<indexterm zone="gtk-menu-item-remove-submenu" role="deprecated"><primary sortas="menu_item_remove_submenu">gtk_menu_item_remove_submenu</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_item_remove_submenu        (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);</programlisting>
<warning><para><literal>gtk_menu_item_remove_submenu</literal> has been deprecated since version 2.12 and should not be used in newly-written code. <link linkend="gtk-menu-item-remove-submenu"><function>gtk_menu_item_remove_submenu()</function></link> is deprecated and
                  should not be used in newly written code. Use
                  <link linkend="gtk-menu-item-set-submenu"><function>gtk_menu_item_set_submenu()</function></link> instead.</para></warning>
<para>
Removes the widget's submenu.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-set-accel-path" role="function">
<title>gtk_menu_item_set_accel_path ()</title>
<indexterm zone="gtk-menu-item-set-accel-path"><primary sortas="menu_item_set_accel_path">gtk_menu_item_set_accel_path</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_item_set_accel_path        (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         const <link linkend="gchar">gchar</link> *accel_path);</programlisting>
<para>
Set the accelerator path on <parameter>menu_item</parameter>, through which runtime changes of the
menu item's accelerator caused by the user can be identified and saved to
persistant storage (see <link linkend="gtk-accel-map-save"><function>gtk_accel_map_save()</function></link> on this).
To setup a default accelerator for this menu item, call
<link linkend="gtk-accel-map-add-entry"><function>gtk_accel_map_add_entry()</function></link> with the same <parameter>accel_path</parameter>.
See also <link linkend="gtk-accel-map-add-entry"><function>gtk_accel_map_add_entry()</function></link> on the specifics of accelerator paths,
and <link linkend="gtk-menu-set-accel-path"><function>gtk_menu_set_accel_path()</function></link> for a more convenient variant of this function.
</para>
<para>
This function is basically a convenience wrapper that handles calling
<link linkend="gtk-widget-set-accel-path"><function>gtk_widget_set_accel_path()</function></link> with the appropriate accelerator group for
the menu item.
</para>
<para>
Note that you do need to set an accelerator on the parent menu with
<link linkend="gtk-menu-set-accel-group"><function>gtk_menu_set_accel_group()</function></link> for this to work.
</para>
<para>
Note that <parameter>accel_path</parameter> string will be stored in a <link linkend="GQuark"><type>GQuark</type></link>. Therefore, if you
pass a static string, you can save some memory by interning it first with 
<link linkend="g-intern-static-string"><function>g_intern_static_string()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara>  a valid <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>accel_path</parameter>&#160;:</term>
<listitem><simpara> accelerator path, corresponding to this menu item's
             functionality, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to unset the current path.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-get-accel-path" role="function" condition="since:2.14">
<title>gtk_menu_item_get_accel_path ()</title>
<indexterm zone="gtk-menu-item-get-accel-path" role="2.14"><primary sortas="menu_item_get_accel_path">gtk_menu_item_get_accel_path</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link>*        gtk_menu_item_get_accel_path        (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);</programlisting>
<para>
Retrieve the accelerator path that was previously set on <parameter>menu_item</parameter>.
</para>
<para>
See <link linkend="gtk-menu-item-set-accel-path"><function>gtk_menu_item_set_accel_path()</function></link> for details.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara>  a valid <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the accelerator path corresponding to this menu item's
             functionality, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if not set

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.14</para></refsect2>
<refsect2 id="gtk-menu-item-select" role="function">
<title>gtk_menu_item_select ()</title>
<indexterm zone="gtk-menu-item-select"><primary sortas="menu_item_select">gtk_menu_item_select</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_item_select                (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);</programlisting>
<para>
Emits the "select" signal on the given item. Behaves exactly like
<link linkend="gtk-item-select"><type>gtk_item_select</type></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara>the menu item
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-deselect" role="function">
<title>gtk_menu_item_deselect ()</title>
<indexterm zone="gtk-menu-item-deselect"><primary sortas="menu_item_deselect">gtk_menu_item_deselect</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_item_deselect              (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);</programlisting>
<para>
Emits the "deselect" signal on the given item. Behaves exactly like
<link linkend="gtk-item-deselect"><type>gtk_item_deselect</type></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara>the menu item
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-activate" role="function">
<title>gtk_menu_item_activate ()</title>
<indexterm zone="gtk-menu-item-activate"><primary sortas="menu_item_activate">gtk_menu_item_activate</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_item_activate              (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item);</programlisting>
<para>
Emits the "activate" signal on the given item
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara>the menu item
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-toggle-size-request" role="function">
<title>gtk_menu_item_toggle_size_request ()</title>
<indexterm zone="gtk-menu-item-toggle-size-request"><primary sortas="menu_item_toggle_size_request">gtk_menu_item_toggle_size_request</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_item_toggle_size_request   (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         <link linkend="gint">gint</link> *requisition);</programlisting>
<para>
Emits the "toggle_size_request" signal on the given item.
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara>the menu item
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>requisition</parameter>&#160;:</term>
<listitem><simpara>the requisition to use as signal data.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-toggle-size-allocate" role="function">
<title>gtk_menu_item_toggle_size_allocate ()</title>
<indexterm zone="gtk-menu-item-toggle-size-allocate"><primary sortas="menu_item_toggle_size_allocate">gtk_menu_item_toggle_size_allocate</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_item_toggle_size_allocate  (<link linkend="GtkMenuItem">GtkMenuItem</link> *menu_item,
                                                         <link linkend="gint">gint</link> allocation);</programlisting>
<para>
Emits the "toggle_size_allocate" signal on the given item.
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara>the menu item.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>allocation</parameter>&#160;:</term>
<listitem><simpara>the allocation to use as signal data.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-item-right-justify" role="macro" condition="deprecated:">
<title>gtk_menu_item_right_justify()</title>
<indexterm zone="gtk-menu-item-right-justify" role="deprecated"><primary sortas="menu_item_right_justify">gtk_menu_item_right_justify</primary></indexterm><programlisting>#define gtk_menu_item_right_justify(menu_item) gtk_menu_item_set_right_justified ((menu_item), TRUE)
</programlisting>
<warning><para><literal>gtk_menu_item_right_justify</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
Sets the menu item to be right-justified. Only useful for menu bars.
</para><variablelist role="params">
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara>the menu item
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="GtkMenuItem.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkMenuItem--accel-path" role="property"><title>The <literal>&quot;accel-path&quot;</literal> property</title>
<indexterm zone="GtkMenuItem--accel-path" role="2.14"><primary sortas="MenuItem:accel-path">GtkMenuItem:accel-path</primary></indexterm><programlisting>  &quot;accel-path&quot;               <link linkend="gchar">gchar</link>*                : Read / Write</programlisting>
<para>
Sets the accelerator path of the menu item, through which runtime
changes of the menu item's accelerator caused by the user can be
identified and saved to persistant storage.</para>
<para>
</para><para>Default value: NULL</para>
<para>Since 2.14</para>
</refsect2>
<refsect2 id="GtkMenuItem--label" role="property"><title>The <literal>&quot;label&quot;</literal> property</title>
<indexterm zone="GtkMenuItem--label" role="2.16"><primary sortas="MenuItem:label">GtkMenuItem:label</primary></indexterm><programlisting>  &quot;label&quot;                    <link linkend="gchar">gchar</link>*                : Read / Write</programlisting>
<para>
The text for the child label.</para>
<para>
</para><para>Default value: ""</para>
<para>Since 2.16</para>
</refsect2>
<refsect2 id="GtkMenuItem--right-justified" role="property"><title>The <literal>&quot;right-justified&quot;</literal> property</title>
<indexterm zone="GtkMenuItem--right-justified" role="2.14"><primary sortas="MenuItem:right-justified">GtkMenuItem:right-justified</primary></indexterm><programlisting>  &quot;right-justified&quot;          <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>
Sets whether the menu item appears justified at the right side of a menu bar.</para>
<para>
</para><para>Default value: FALSE</para>
<para>Since 2.14</para>
</refsect2>
<refsect2 id="GtkMenuItem--submenu" role="property"><title>The <literal>&quot;submenu&quot;</literal> property</title>
<indexterm zone="GtkMenuItem--submenu" role="2.12"><primary sortas="MenuItem:submenu">GtkMenuItem:submenu</primary></indexterm><programlisting>  &quot;submenu&quot;                  <link linkend="GtkMenu">GtkMenu</link>*              : Read / Write</programlisting>
<para>
The submenu attached to the menu item, or NULL if it has none.</para>
<para>
</para><para>Since 2.12</para>
</refsect2>
<refsect2 id="GtkMenuItem--use-underline" role="property"><title>The <literal>&quot;use-underline&quot;</literal> property</title>
<indexterm zone="GtkMenuItem--use-underline" role="2.16"><primary sortas="MenuItem:use-underline">GtkMenuItem:use-underline</primary></indexterm><programlisting>  &quot;use-underline&quot;            <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>
<link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if underlines in the text indicate mnemonics</para>
<para>
</para><para>Default value: FALSE</para>
<para>Since 2.16</para>
</refsect2>
</refsect1>
<refsect1 id="GtkMenuItem.style-property-details" role="style_properties_details">
<title role="style_properties_details.title">Style Property Details</title>
<refsect2 id="GtkMenuItem--s-arrow-scaling" role="property"><title>The <literal>&quot;arrow-scaling&quot;</literal> style property</title>
<indexterm zone="GtkMenuItem--s-arrow-scaling"><primary sortas="MenuItem:arrow-scaling">GtkMenuItem:arrow-scaling</primary></indexterm><programlisting>  &quot;arrow-scaling&quot;            <link linkend="gfloat">gfloat</link>                : Read</programlisting>
<para>Amount of space used up by arrow, relative to the menu item's font size.</para><para>Allowed values: [0,2]</para>
<para>Default value: 0.8</para>
</refsect2>
<refsect2 id="GtkMenuItem--s-arrow-spacing" role="property"><title>The <literal>&quot;arrow-spacing&quot;</literal> style property</title>
<indexterm zone="GtkMenuItem--s-arrow-spacing"><primary sortas="MenuItem:arrow-spacing">GtkMenuItem:arrow-spacing</primary></indexterm><programlisting>  &quot;arrow-spacing&quot;            <link linkend="gint">gint</link>                  : Read</programlisting>
<para>Space between label and arrow.</para><para>Allowed values: &gt;= 0</para>
<para>Default value: 10</para>
</refsect2>
<refsect2 id="GtkMenuItem--s-horizontal-padding" role="property"><title>The <literal>&quot;horizontal-padding&quot;</literal> style property</title>
<indexterm zone="GtkMenuItem--s-horizontal-padding"><primary sortas="MenuItem:horizontal-padding">GtkMenuItem:horizontal-padding</primary></indexterm><programlisting>  &quot;horizontal-padding&quot;       <link linkend="gint">gint</link>                  : Read</programlisting>
<para>Padding to left and right of the menu item.</para><para>Allowed values: &gt;= 0</para>
<para>Default value: 3</para>
</refsect2>
<refsect2 id="GtkMenuItem--s-selected-shadow-type" role="property"><title>The <literal>&quot;selected-shadow-type&quot;</literal> style property</title>
<indexterm zone="GtkMenuItem--s-selected-shadow-type"><primary sortas="MenuItem:selected-shadow-type">GtkMenuItem:selected-shadow-type</primary></indexterm><programlisting>  &quot;selected-shadow-type&quot;     <link linkend="GtkShadowType">GtkShadowType</link>         : Read</programlisting>
<para>Shadow type when item is selected.</para><para>Default value: GTK_SHADOW_NONE</para>
</refsect2>
<refsect2 id="GtkMenuItem--s-toggle-spacing" role="property"><title>The <literal>&quot;toggle-spacing&quot;</literal> style property</title>
<indexterm zone="GtkMenuItem--s-toggle-spacing"><primary sortas="MenuItem:toggle-spacing">GtkMenuItem:toggle-spacing</primary></indexterm><programlisting>  &quot;toggle-spacing&quot;           <link linkend="gint">gint</link>                  : Read</programlisting>
<para>Space between icon and label.</para><para>Allowed values: &gt;= 0</para>
<para>Default value: 5</para>
</refsect2>
<refsect2 id="GtkMenuItem--s-width-chars" role="property"><title>The <literal>&quot;width-chars&quot;</literal> style property</title>
<indexterm zone="GtkMenuItem--s-width-chars" role="2.14"><primary sortas="MenuItem:width-chars">GtkMenuItem:width-chars</primary></indexterm><programlisting>  &quot;width-chars&quot;              <link linkend="gint">gint</link>                  : Read</programlisting>
<para>
The minimum desired width of the menu item in characters.</para>
<para>
</para><para>Allowed values: &gt;= 0</para>
<para>Default value: 12</para>
<para>Since 2.14</para>
</refsect2>
</refsect1>

<refsect1 id="GtkMenuItem.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkMenuItem-activate" role="signal"><title>The <literal>&quot;activate&quot;</literal> signal</title>
<indexterm zone="GtkMenuItem-activate"><primary sortas="MenuItem::activate">GtkMenuItem::activate</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkMenuItem">GtkMenuItem</link> *menuitem,
                                                        <link linkend="gpointer">gpointer</link>     user_data)      : Run First / Action</programlisting>
<para>
Emitted when the item is activated.
</para><variablelist role="params">
<varlistentry><term><parameter>menuitem</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.
</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><refsect2 id="GtkMenuItem-activate-item" role="signal"><title>The <literal>&quot;activate-item&quot;</literal> signal</title>
<indexterm zone="GtkMenuItem-activate-item"><primary sortas="MenuItem::activate-item">GtkMenuItem::activate-item</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkMenuItem">GtkMenuItem</link> *menuitem,
                                                        <link linkend="gpointer">gpointer</link>     user_data)      : Run First</programlisting>
<para>
Emitted when the item is activated, but also if the menu item has a
submenu. For normal applications, the relevant signal is "activate".
</para><variablelist role="params">
<varlistentry><term><parameter>menuitem</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.
</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><refsect2 id="GtkMenuItem-toggle-size-allocate" role="signal"><title>The <literal>&quot;toggle-size-allocate&quot;</literal> signal</title>
<indexterm zone="GtkMenuItem-toggle-size-allocate"><primary sortas="MenuItem::toggle-size-allocate">GtkMenuItem::toggle-size-allocate</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkMenuItem">GtkMenuItem</link> *menuitem,
                                                        <link linkend="gint">gint</link>         arg1,
                                                        <link linkend="gpointer">gpointer</link>     user_data)      : Run First</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menuitem</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>arg1</parameter>&#160;:</term>
<listitem><simpara>
</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><refsect2 id="GtkMenuItem-toggle-size-request" role="signal"><title>The <literal>&quot;toggle-size-request&quot;</literal> signal</title>
<indexterm zone="GtkMenuItem-toggle-size-request"><primary sortas="MenuItem::toggle-size-request">GtkMenuItem::toggle-size-request</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkMenuItem">GtkMenuItem</link> *menuitem,
                                                        <link linkend="gpointer">gpointer</link>     arg1,
                                                        <link linkend="gpointer">gpointer</link>     user_data)      : Run First</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menuitem</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>arg1</parameter>&#160;:</term>
<listitem><simpara>
</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>


<refsect1 id="GtkMenuItem.see-also">
<title>See Also</title>
<para>
<variablelist>
<varlistentry>
<term><link linkend="GtkBin"><type>GtkBin</type></link></term>
<listitem><para>for how to handle the child.</para></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GtkItem"><type>GtkItem</type></link></term>
<listitem><para>is the abstract class for all sorts of items.</para></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GtkMenuShell"><type>GtkMenuShell</type></link></term>
<listitem><para>is always the parent of <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link>.</para></listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

</refentry>
