|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/share/gtk-doc/html/gtk/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>GtkMenuItem</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="GTK+ Reference Manual">
<link rel="up" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
<link rel="prev" href="GtkMenuBar.html" title="GtkMenuBar">
<link rel="next" href="GtkMenuShell.html" title="GtkMenuShell">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="gtk.html" title="Part I. GTK+ Overview">
<link rel="part" href="gtkbase.html" title="Part II. GTK+ Core Reference">
<link rel="part" href="gtkobjects.html" title="Part III. GTK+ Widgets and Objects">
<link rel="chapter" href="ch01.html" title="Object Hierarchy">
<link rel="chapter" href="ch02.html" title="Widget Gallery">
<link rel="chapter" href="WindowWidgets.html" title="Windows">
<link rel="chapter" href="DisplayWidgets.html" title="Display Widgets">
<link rel="chapter" href="ButtonWidgets.html" title="Buttons and Toggles">
<link rel="chapter" href="NumericEntry.html" title="Numeric/Text Data Entry">
<link rel="chapter" href="TextWidgetObjects.html" title="Multiline Text Editor">
<link rel="chapter" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
<link rel="chapter" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
<link rel="chapter" href="Actions.html" title="Action-based menus and toolbars">
<link rel="chapter" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)">
<link rel="chapter" href="LayoutContainers.html" title="Layout Containers">
<link rel="chapter" href="Ornaments.html" title="Ornaments">
<link rel="chapter" href="ScrollingWidgets.html" title="Scrolling">
<link rel="chapter" href="Printing.html" title="Printing">
<link rel="chapter" href="MiscObjects.html" title="Miscellaneous">
<link rel="chapter" href="AbstractObjects.html" title="Abstract Base Classes">
<link rel="chapter" href="PlugSocket.html" title="Cross-process Embedding">
<link rel="chapter" href="SpecialObjects.html" title="Special-purpose features">
<link rel="chapter" href="RecentDocuments.html" title="Recently Used Documents">
<link rel="chapter" href="DeprecatedObjects.html" title="Deprecated">
<link rel="part" href="migrating.html" title="Part IV. Migrating from Previous Versions of GTK+">
<link rel="chapter" href="gtk-migrating-checklist.html" title="Migration Checklist">
<link rel="chapter" href="gtk-migrating-GtkFileChooser.html" title="Migrating from GtkFileSelection to GtkFileChooser">
<link rel="chapter" href="gtk-migrating-GtkAction.html" title="Migrating from old menu and toolbar systems to GtkAction">
<link rel="chapter" href="gtk-migrating-GtkComboBox.html" title="Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and
GtkComboBoxEntry">
<link rel="chapter" href="gtk-migrating-GtkIconView.html" title="Migrating from GnomeIconList to GtkIconView">
<link rel="chapter" href="gtk-migrating-GtkAboutDialog.html" title="Migrating from GnomeAbout to GtkAboutDialog">
<link rel="chapter" href="gtk-migrating-GtkColorButton.html" title="Migrating from GnomeColorPicker to GtkColorButton">
<link rel="chapter" href="gtk-migrating-GtkAssistant.html" title="Migrating from GnomeDruid to GtkAssistant">
<link rel="chapter" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser">
<link rel="chapter" href="gtk-migrating-GtkLinkButton.html" title="Migrating from GnomeHRef to GtkLinkButton">
<link rel="part" href="pt05.html" title="Part V. GTK+ Tools">
<link rel="glossary" href="glossary.html" title="Glossary">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GtkMenuBar.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="MenusAndCombos.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ Reference Manual</th>
<td><a accesskey="n" href="GtkMenuShell.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3284882" class="shortcut">Top</a>
 | 
<a href="#id3285635" class="shortcut">Description</a>
 | 
<a href="#id3285264" class="shortcut">Object Hierarchy</a>
 | 
<a href="#id3285365" class="shortcut">Implemented Interfaces</a>
 | 
<a href="#id3285388" class="shortcut">Style Properties</a>
 | 
<a href="#id3285474" class="shortcut">Signals</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="GtkMenuItem"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3284882"></a><span class="refentrytitle">GtkMenuItem</span>
</h2>
<p>GtkMenuItem — The widget used for item in menus</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <gtk/gtk.h>
<a href="GtkMenuItem.html#GtkMenuItem-struct">GtkMenuItem</a>;
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* <a href="GtkMenuItem.html#gtk-menu-item-new">gtk_menu_item_new</a> (void);
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* <a href="GtkMenuItem.html#gtk-menu-item-new-with-label">gtk_menu_item_new_with_label</a> (const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *label);
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* <a href="GtkMenuItem.html#gtk-menu-item-new-with-mnemonic">gtk_menu_item_new_with_mnemonic</a> (const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *label);
void <a href="GtkMenuItem.html#gtk-menu-item-set-right-justified">gtk_menu_item_set_right_justified</a>
(<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> right_justified);
void <a href="GtkMenuItem.html#gtk-menu-item-set-submenu">gtk_menu_item_set_submenu</a> (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item,
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *submenu);
void <a href="GtkMenuItem.html#gtk-menu-item-set-accel-path">gtk_menu_item_set_accel_path</a> (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item,
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *accel_path);
void <a href="GtkMenuItem.html#gtk-menu-item-remove-submenu">gtk_menu_item_remove_submenu</a> (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item);
void <a href="GtkMenuItem.html#gtk-menu-item-select">gtk_menu_item_select</a> (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item);
void <a href="GtkMenuItem.html#gtk-menu-item-deselect">gtk_menu_item_deselect</a> (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item);
void <a href="GtkMenuItem.html#gtk-menu-item-activate">gtk_menu_item_activate</a> (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item);
void <a href="GtkMenuItem.html#gtk-menu-item-toggle-size-request">gtk_menu_item_toggle_size_request</a>
(<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *requisition);
void <a href="GtkMenuItem.html#gtk-menu-item-toggle-size-allocate">gtk_menu_item_toggle_size_allocate</a>
(<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> allocation);
#define <a href="GtkMenuItem.html#gtk-menu-item-right-justify">gtk_menu_item_right_justify</a> (menu_item)
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="GtkMenuItem.html#gtk-menu-item-get-right-justified">gtk_menu_item_get_right_justified</a>
(<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item);
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* <a href="GtkMenuItem.html#gtk-menu-item-get-submenu">gtk_menu_item_get_submenu</a> (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3285264"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a
href="../gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>
+----<a
href="../gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned"
>GInitiallyUnowned</a>
+----<a href="GtkObject.html" title="GtkObject">GtkObject</a>
+----<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
+----<a href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
+----<a href="GtkBin.html" title="GtkBin">GtkBin</a>
+----<a href="GtkItem.html" title="GtkItem">GtkItem</a>
+----GtkMenuItem
+----<a href="GtkCheckMenuItem.html" title="GtkCheckMenuItem">GtkCheckMenuItem</a>
+----<a href="GtkImageMenuItem.html" title="GtkImageMenuItem">GtkImageMenuItem</a>
+----<a href="GtkSeparatorMenuItem.html" title="GtkSeparatorMenuItem">GtkSeparatorMenuItem</a>
+----<a href="GtkTearoffMenuItem.html" title="GtkTearoffMenuItem">GtkTearoffMenuItem</a>
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3285365"></a><h2>Implemented Interfaces</h2>
<p>
GtkMenuItem implements
AtkImplementorIface.</p>
</div>
<div class="refsect1" lang="en">
<a name="id3285388"></a><h2>Style Properties</h2>
<pre class="synopsis">
"<a href="GtkMenuItem.html#GtkMenuItem--arrow-spacing">arrow-spacing</a>" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read
"<a href="GtkMenuItem.html#GtkMenuItem--horizontal-padding">horizontal-padding</a>" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read
"<a href="GtkMenuItem.html#GtkMenuItem--selected-shadow-type">selected-shadow-type</a>" <a href="gtk-Standard-Enumerations.html#GtkShadowType">GtkShadowType</a> : Read
"<a href="GtkMenuItem.html#GtkMenuItem--toggle-spacing">toggle-spacing</a>" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3285474"></a><h2>Signals</h2>
<pre class="synopsis">
"<a href="GtkMenuItem.html#GtkMenuItem-activate">activate</a>" void user_function (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menuitem,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run first / Action
"<a href="GtkMenuItem.html#GtkMenuItem-activate-item">activate-item</a>"
void user_function (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menuitem,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run first
"<a href="GtkMenuItem.html#GtkMenuItem-toggle-size-allocate">toggle-size-allocate</a>"
void user_function (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menuitem,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> arg1,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run first
"<a href="GtkMenuItem.html#GtkMenuItem-toggle-size-request">toggle-size-request</a>"
void user_function (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menuitem,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> arg1,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run first
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3285635"></a><h2>Description</h2>
<p>
The <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> widget and the derived widgets are the only valid
childs for menus. Their function is to correctly handle highlighting,
alignment, events and submenus.
</p>
<p>
As it derives from <a href="GtkBin.html" title="GtkBin"><span class="type">GtkBin</span></a> it can hold any valid child widget, altough
only a few are really useful.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id3285673"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3285683"></a><h3>
<a name="GtkMenuItem-struct"></a>GtkMenuItem</h3>
<a class="indexterm" name="id3285696"></a><pre class="programlisting">typedef struct _GtkMenuItem GtkMenuItem;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3285711"></a><h3>
<a name="gtk-menu-item-new"></a>gtk_menu_item_new ()</h3>
<a class="indexterm" name="id3285725"></a><pre class="programlisting"><a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_menu_item_new (void);</pre>
<p>
Creates a new <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>the newly created <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3285776"></a><h3>
<a name="gtk-menu-item-new-with-label"></a>gtk_menu_item_new_with_label ()</h3>
<a class="indexterm" name="id3285790"></a><pre class="programlisting"><a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_menu_item_new_with_label (const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *label);</pre>
<p>
Creates a new <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> whose child is a <a href="GtkLabel.html" title="GtkLabel"><span class="type">GtkLabel</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>label</code></em> :</span></td>
<td>the text for the label
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>the newly created <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3285871"></a><h3>
<a name="gtk-menu-item-new-with-mnemonic"></a>gtk_menu_item_new_with_mnemonic ()</h3>
<a class="indexterm" name="id3285885"></a><pre class="programlisting"><a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_menu_item_new_with_mnemonic (const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *label);</pre>
<p>
Creates a new <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> containing a label. The label
will be created using <a href="GtkLabel.html#gtk-label-new-with-mnemonic"><code class="function">gtk_label_new_with_mnemonic()</code></a>, so underscores
in <em class="parameter"><code>label</code></em> indicate the mnemonic for the menu item.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>label</code></em> :</span></td>
<td> The text of the button, with an underscore in front of the
mnemonic character
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a new <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3285981"></a><h3>
<a name="gtk-menu-item-set-right-justified"></a>gtk_menu_item_set_right_justified ()</h3>
<a class="indexterm" name="id3285996"></a><pre class="programlisting">void gtk_menu_item_set_right_justified
(<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> right_justified);</pre>
<p>
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.)</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td> a <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>right_justified</code></em> :</span></td>
<td> if <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> the menu item will appear at the
far right if added to a menu bar.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3284786"></a><h3>
<a name="gtk-menu-item-set-submenu"></a>gtk_menu_item_set_submenu ()</h3>
<a class="indexterm" name="id3284800"></a><pre class="programlisting">void gtk_menu_item_set_submenu (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item,
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *submenu);</pre>
<p>
Sets the widget submenu, or changes it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td>the menu item widget
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>submenu</code></em> :</span></td>
<td>the submenu
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3286310"></a><h3>
<a name="gtk-menu-item-set-accel-path"></a>gtk_menu_item_set_accel_path ()</h3>
<a class="indexterm" name="id3286324"></a><pre class="programlisting">void gtk_menu_item_set_accel_path (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item,
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *accel_path);</pre>
<p>
Set the accelerator path on <em class="parameter"><code>menu_item</code></em>, through which runtime changes of the
menu item's accelerator caused by the user can be identified and saved to
persistant storage (see <a href="gtk-Accelerator-Maps.html#gtk-accel-map-save"><code class="function">gtk_accel_map_save()</code></a> on this).
To setup a default accelerator for this menu item, call
<a href="gtk-Accelerator-Maps.html#gtk-accel-map-add-entry"><code class="function">gtk_accel_map_add_entry()</code></a> with the same <em class="parameter"><code>accel_path</code></em>.
See also <a href="gtk-Accelerator-Maps.html#gtk-accel-map-add-entry"><code class="function">gtk_accel_map_add_entry()</code></a> on the specifics of accelerator paths,
and <a href="GtkMenu.html#gtk-menu-set-accel-path"><code class="function">gtk_menu_set_accel_path()</code></a> for a more convenient variant of this function.
</p>
<p>
This function is basically a convenience wrapper that handles calling
<a href="GtkWidget.html#gtk-widget-set-accel-path"><code class="function">gtk_widget_set_accel_path()</code></a> with the appropriate accelerator group for
the menu item.
</p>
<p>
Note that you do need to set an accelerator on the parent menu with
<a href="GtkMenu.html#gtk-menu-set-accel-group"><code class="function">gtk_menu_set_accel_group()</code></a> for this to work.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td> a valid <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>accel_path</code></em> :</span></td>
<td> accelerator path, corresponding to this menu item's
functionality, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to unset the current path.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3286509"></a><h3>
<a name="gtk-menu-item-remove-submenu"></a>gtk_menu_item_remove_submenu ()</h3>
<a class="indexterm" name="id3286523"></a><pre class="programlisting">void gtk_menu_item_remove_submenu (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item);</pre>
<p>
Removes the widget's submenu.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td>the menu item widget
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3286570"></a><h3>
<a name="gtk-menu-item-select"></a>gtk_menu_item_select ()</h3>
<a class="indexterm" name="id3286583"></a><pre class="programlisting">void gtk_menu_item_select (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item);</pre>
<p>
Emits the "select" signal on the given item. Behaves exactly like
<a href="GtkItem.html#gtk-item-select"><span class="type">gtk_item_select</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td>the menu item
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3286640"></a><h3>
<a name="gtk-menu-item-deselect"></a>gtk_menu_item_deselect ()</h3>
<a class="indexterm" name="id3286653"></a><pre class="programlisting">void gtk_menu_item_deselect (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item);</pre>
<p>
Emits the "deselect" signal on the given item. Behaves exactly like
<a href="GtkItem.html#gtk-item-deselect"><span class="type">gtk_item_deselect</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td>the menu item
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3286711"></a><h3>
<a name="gtk-menu-item-activate"></a>gtk_menu_item_activate ()</h3>
<a class="indexterm" name="id3286723"></a><pre class="programlisting">void gtk_menu_item_activate (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item);</pre>
<p>
Emits the "activate" signal on the given item
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td>the menu item
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3286771"></a><h3>
<a name="gtk-menu-item-toggle-size-request"></a>gtk_menu_item_toggle_size_request ()</h3>
<a class="indexterm" name="id3286785"></a><pre class="programlisting">void gtk_menu_item_toggle_size_request
(<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *requisition);</pre>
<p>
Emits the "toggle_size_request" signal on the given item.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td>the menu item
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>requisition</code></em> :</span></td>
<td>the requisition to use as signal data.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3286855"></a><h3>
<a name="gtk-menu-item-toggle-size-allocate"></a>gtk_menu_item_toggle_size_allocate ()</h3>
<a class="indexterm" name="id3286870"></a><pre class="programlisting">void gtk_menu_item_toggle_size_allocate
(<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> allocation);</pre>
<p>
Emits the "toggle_size_allocate" signal on the given item.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td>the menu item.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>allocation</code></em> :</span></td>
<td>the allocation to use as signal data.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3286940"></a><h3>
<a name="gtk-menu-item-right-justify"></a>gtk_menu_item_right_justify()</h3>
<a class="indexterm" name="id3286956"></a><pre class="programlisting">#define gtk_menu_item_right_justify(menu_item) gtk_menu_item_set_right_justified ((menu_item), TRUE)
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gtk_menu_item_right_justify</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Sets the menu item to be right-justified. Only useful for menu bars.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td>the menu item
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3287004"></a><h3>
<a name="gtk-menu-item-get-right-justified"></a>gtk_menu_item_get_right_justified ()</h3>
<a class="indexterm" name="id3287018"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gtk_menu_item_get_right_justified
(<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item);</pre>
<p>
Gets whether the menu item appears justified at the right
side of the menu bar.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td> a <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the menu item will appear at the
far right if added to a menu bar.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3287099"></a><h3>
<a name="gtk-menu-item-get-submenu"></a>gtk_menu_item_get_submenu ()</h3>
<a class="indexterm" name="id3287112"></a><pre class="programlisting"><a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_menu_item_get_submenu (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menu_item);</pre>
<p>
Gets the submenu underneath this menu item, if any. See
<a href="GtkMenuItem.html#gtk-menu-item-set-submenu"><code class="function">gtk_menu_item_set_submenu()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td> a <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> submenu for this menu item, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> if none.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3287203"></a><h2>Style Property Details</h2>
<div class="refsect2" lang="en">
<a name="id3287214"></a><h3>
<a name="GtkMenuItem--arrow-spacing"></a>The "<code class="literal">arrow-spacing</code>" style property</h3>
<a class="indexterm" name="id3287230"></a><pre class="programlisting"> "arrow-spacing" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read</pre>
<p>Space between label and arrow.</p>
<p>Allowed values: >= 0</p>
<p>Default value: 10</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3287261"></a><h3>
<a name="GtkMenuItem--horizontal-padding"></a>The "<code class="literal">horizontal-padding</code>" style property</h3>
<a class="indexterm" name="id3287278"></a><pre class="programlisting"> "horizontal-padding" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read</pre>
<p>Padding to left and right of the menu item.</p>
<p>Allowed values: >= 0</p>
<p>Default value: 3</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3287309"></a><h3>
<a name="GtkMenuItem--selected-shadow-type"></a>The "<code class="literal">selected-shadow-type</code>" style property</h3>
<a class="indexterm" name="id3287326"></a><pre class="programlisting"> "selected-shadow-type" <a href="gtk-Standard-Enumerations.html#GtkShadowType">GtkShadowType</a> : Read</pre>
<p>Shadow type when item is selected.</p>
<p>Default value: GTK_SHADOW_NONE</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3287353"></a><h3>
<a name="GtkMenuItem--toggle-spacing"></a>The "<code class="literal">toggle-spacing</code>" style property</h3>
<a class="indexterm" name="id3287370"></a><pre class="programlisting"> "toggle-spacing" <a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> : Read</pre>
<p>Space between icon and label.</p>
<p>Allowed values: >= 0</p>
<p>Default value: 5</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3287402"></a><h2>Signal Details</h2>
<div class="refsect2" lang="en">
<a name="id3287412"></a><h3>
<a name="GtkMenuItem-activate"></a>The "activate" signal</h3>
<a class="indexterm" name="id3287423"></a><pre class="programlisting">void user_function (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menuitem,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run first / Action</pre>
<p>
Emitted when the item is activated.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menuitem</code></em> :</span></td>
<td>the object which received the signal.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3287492"></a><h3>
<a name="GtkMenuItem-activate-item"></a>The "activate-item" signal</h3>
<a class="indexterm" name="id3287503"></a><pre class="programlisting">void user_function (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menuitem,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run first</pre>
<p>
Emitted when the item is activated, but also if the menu item has a
submenu. For normal applications, the relevant signal is "activate".
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menuitem</code></em> :</span></td>
<td>the object which received the signal.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3287573"></a><h3>
<a name="GtkMenuItem-toggle-size-allocate"></a>The "toggle-size-allocate" signal</h3>
<a class="indexterm" name="id3287584"></a><pre class="programlisting">void user_function (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menuitem,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> arg1,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run first</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menuitem</code></em> :</span></td>
<td>the object which received the signal.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>arg1</code></em> :</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3287673"></a><h3>
<a name="GtkMenuItem-toggle-size-request"></a>The "toggle-size-request" signal</h3>
<a class="indexterm" name="id3287685"></a><pre class="programlisting">void user_function (<a href="GtkMenuItem.html" title="GtkMenuItem">GtkMenuItem</a> *menuitem,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> arg1,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run first</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menuitem</code></em> :</span></td>
<td>the object which received the signal.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>arg1</code></em> :</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3287776"></a><h2>See Also</h2>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a href="GtkBin.html" title="GtkBin"><span class="type">GtkBin</span></a></span></td>
<td><p>for how to handle the child.</p></td>
</tr>
<tr>
<td>
<span class="term"><a href="GtkItem.html" title="GtkItem"><span class="type">GtkItem</span></a></span></td>
<td><p>is the abstract class for all sorts of items.</p></td>
</tr>
<tr>
<td>
<span class="term"><a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a></span></td>
<td><p>is always the parent of <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a>.</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</div>
</div>
</body>
</html>