|
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>GtkMenuShell</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="GtkMenuItem.html" title="GtkMenuItem">
<link rel="next" href="GtkImageMenuItem.html" title="GtkImageMenuItem">
<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="GtkMenuItem.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="GtkImageMenuItem.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="#id3290459" class="shortcut">Top</a>
 | 
<a href="#id3291176" class="shortcut">Description</a>
 | 
<a href="#id3290811" class="shortcut">Object Hierarchy</a>
 | 
<a href="#id3290880" class="shortcut">Implemented Interfaces</a>
 | 
<a href="#id3290903" class="shortcut">Properties</a>
 | 
<a href="#id3290937" class="shortcut">Signals</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="GtkMenuShell"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3290459"></a><span class="refentrytitle">GtkMenuShell</span>
</h2>
<p>GtkMenuShell — A base class for menu objects</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="GtkMenuShell.html#GtkMenuShell-struct">GtkMenuShell</a>;
void <a href="GtkMenuShell.html#gtk-menu-shell-append">gtk_menu_shell_append</a> (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *child);
void <a href="GtkMenuShell.html#gtk-menu-shell-prepend">gtk_menu_shell_prepend</a> (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *child);
void <a href="GtkMenuShell.html#gtk-menu-shell-insert">gtk_menu_shell_insert</a> (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *child,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> position);
void <a href="GtkMenuShell.html#gtk-menu-shell-deactivate">gtk_menu_shell_deactivate</a> (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell);
void <a href="GtkMenuShell.html#gtk-menu-shell-select-item">gtk_menu_shell_select_item</a> (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *menu_item);
void <a href="GtkMenuShell.html#gtk-menu-shell-select-first">gtk_menu_shell_select_first</a> (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> search_sensitive);
void <a href="GtkMenuShell.html#gtk-menu-shell-deselect">gtk_menu_shell_deselect</a> (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell);
void <a href="GtkMenuShell.html#gtk-menu-shell-activate-item">gtk_menu_shell_activate_item</a> (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *menu_item,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> force_deactivate);
void <a href="GtkMenuShell.html#gtk-menu-shell-cancel">gtk_menu_shell_cancel</a> (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell);
void <a href="GtkMenuShell.html#gtk-menu-shell-set-take-focus">gtk_menu_shell_set_take_focus</a> (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> take_focus);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="GtkMenuShell.html#gtk-menu-shell-get-take-focus">gtk_menu_shell_get_take_focus</a> (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell);
enum <a href="GtkMenuShell.html#GtkMenuDirectionType">GtkMenuDirectionType</a>;
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3290811"></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>
+----GtkMenuShell
+----<a href="GtkMenuBar.html" title="GtkMenuBar">GtkMenuBar</a>
+----<a href="GtkMenu.html" title="GtkMenu">GtkMenu</a>
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3290880"></a><h2>Implemented Interfaces</h2>
<p>
GtkMenuShell implements
AtkImplementorIface.</p>
</div>
<div class="refsect1" lang="en">
<a name="id3290903"></a><h2>Properties</h2>
<pre class="synopsis">
"<a href="GtkMenuShell.html#GtkMenuShell--take-focus">take-focus</a>" <a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> : Read / Write
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3290937"></a><h2>Signals</h2>
<pre class="synopsis">
"<a href="GtkMenuShell.html#GtkMenuShell-activate-current">activate-current</a>"
void user_function (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menushell,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> force_hide,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last / Action
"<a href="GtkMenuShell.html#GtkMenuShell-cancel">cancel</a>" void user_function (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menushell,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last / Action
"<a href="GtkMenuShell.html#GtkMenuShell-cycle-focus">cycle-focus</a>"
void user_function (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menushell,
<a href="gtk-Standard-Enumerations.html#GtkDirectionType">GtkDirectionType</a> *arg1,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last / Action
"<a href="GtkMenuShell.html#GtkMenuShell-deactivate">deactivate</a>"
void user_function (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menushell,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run first
"<a href="GtkMenuShell.html#GtkMenuShell-move-current">move-current</a>"
void user_function (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menushell,
<a href="GtkMenuShell.html#GtkMenuDirectionType">GtkMenuDirectionType</a> direction,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last / Action
"<a href="GtkMenuShell.html#GtkMenuShell-selection-done">selection-done</a>"
void user_function (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menushell,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run first
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3291176"></a><h2>Description</h2>
<p>
A <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a> is the abstract base class used to derive the
<a href="GtkMenu.html" title="GtkMenu"><span class="type">GtkMenu</span></a> and <a href="GtkMenuBar.html" title="GtkMenuBar"><span class="type">GtkMenuBar</span></a> subclasses.
</p>
<p>
A <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a> is a container of <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> objects arranged in a
list which can be navigated, selected, and activated by the user to perform
application functions. A <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> can have a submenu associated with it,
allowing for nested hierarchical menus.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id3291246"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3291256"></a><h3>
<a name="GtkMenuShell-struct"></a>GtkMenuShell</h3>
<a class="indexterm" name="id3291269"></a><pre class="programlisting">typedef struct _GtkMenuShell GtkMenuShell;</pre>
<p>
The <a href="GtkMenuShell.html#GtkMenuShell-struct"><span class="type">GtkMenuShell</span></a> struct contains the following fields.
(These fields should be considered read-only. They should never be set by
an application.)
</p>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col>
<col>
</colgroup>
<tbody><tr>
<td>
<a
href="../glib/glib-Doubly-Linked-Lists.html#GList"
><span class="type">GList</span></a> *children;</td>
<td>The list of <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> objects contained by this <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a>.
</td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3291355"></a><h3>
<a name="gtk-menu-shell-append"></a>gtk_menu_shell_append ()</h3>
<a class="indexterm" name="id3291368"></a><pre class="programlisting">void gtk_menu_shell_append (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *child);</pre>
<p>
Adds a new <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> to the end of the menu shell's item list.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_shell</code></em> :</span></td>
<td>a <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>child</code></em> :</span></td>
<td>The <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> to add.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3291459"></a><h3>
<a name="gtk-menu-shell-prepend"></a>gtk_menu_shell_prepend ()</h3>
<a class="indexterm" name="id3291472"></a><pre class="programlisting">void gtk_menu_shell_prepend (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *child);</pre>
<p>
Adds a new <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> to the beginning of the menu shell's item list.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_shell</code></em> :</span></td>
<td>a <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>child</code></em> :</span></td>
<td>The <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> to add.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3291565"></a><h3>
<a name="gtk-menu-shell-insert"></a>gtk_menu_shell_insert ()</h3>
<a class="indexterm" name="id3291578"></a><pre class="programlisting">void gtk_menu_shell_insert (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *child,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> position);</pre>
<p>
Adds a new <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> to the menu shell's item list at the position
indicated by <em class="parameter"><code>position</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_shell</code></em> :</span></td>
<td>a <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>child</code></em> :</span></td>
<td>The <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> to add.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>position</code></em> :</span></td>
<td>The position in the item list where <em class="parameter"><code>child</code></em> is added.
Positions are numbered from 0 to n-1.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3291706"></a><h3>
<a name="gtk-menu-shell-deactivate"></a>gtk_menu_shell_deactivate ()</h3>
<a class="indexterm" name="id3291720"></a><pre class="programlisting">void gtk_menu_shell_deactivate (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell);</pre>
<p>
Deactivates the menu shell. Typically this results in the menu shell
being erased from the screen.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>menu_shell</code></em> :</span></td>
<td>a <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3291776"></a><h3>
<a name="gtk-menu-shell-select-item"></a>gtk_menu_shell_select_item ()</h3>
<a class="indexterm" name="id3291790"></a><pre class="programlisting">void gtk_menu_shell_select_item (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *menu_item);</pre>
<p>
Selects the menu item from the menu shell.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_shell</code></em> :</span></td>
<td>a <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td>The <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> to select.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3291875"></a><h3>
<a name="gtk-menu-shell-select-first"></a>gtk_menu_shell_select_first ()</h3>
<a class="indexterm" name="id3291890"></a><pre class="programlisting">void gtk_menu_shell_select_first (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> search_sensitive);</pre>
<p>
Select the first visible or selectable child of the menu shell;
don't select tearoff items unless the only item is a tearoff
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>menu_shell</code></em> :</span></td>
<td> a <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>search_sensitive</code></em> :</span></td>
<td> if <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a>, search for the first selectable
menu item, otherwise select nothing if
the first item isn't sensitive. This
should be <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> if the menu is being
popped up initially.
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3292000"></a><h3>
<a name="gtk-menu-shell-deselect"></a>gtk_menu_shell_deselect ()</h3>
<a class="indexterm" name="id3292014"></a><pre class="programlisting">void gtk_menu_shell_deselect (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell);</pre>
<p>
Deselects the currently selected item from the menu shell, if any.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>menu_shell</code></em> :</span></td>
<td>a <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3292070"></a><h3>
<a name="gtk-menu-shell-activate-item"></a>gtk_menu_shell_activate_item ()</h3>
<a class="indexterm" name="id3292084"></a><pre class="programlisting">void gtk_menu_shell_activate_item (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *menu_item,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> force_deactivate);</pre>
<p>
Activates the menu item within the menu shell.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_shell</code></em> :</span></td>
<td>a <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>menu_item</code></em> :</span></td>
<td>The <a href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> to activate.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>force_deactivate</code></em> :</span></td>
<td>If TRUE, force the deactivation of the menu shell
after the menu item is activated.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3292192"></a><h3>
<a name="gtk-menu-shell-cancel"></a>gtk_menu_shell_cancel ()</h3>
<a class="indexterm" name="id3292207"></a><pre class="programlisting">void gtk_menu_shell_cancel (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell);</pre>
<p>
Cancels the selection within the menu shell.</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_shell</code></em> :</span></td>
<td> a <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a>
</td>
</tr></tbody>
</table></div>
<p>Since 2.4
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3292271"></a><h3>
<a name="gtk-menu-shell-set-take-focus"></a>gtk_menu_shell_set_take_focus ()</h3>
<a class="indexterm" name="id3292286"></a><pre class="programlisting">void gtk_menu_shell_set_take_focus (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> take_focus);</pre>
<p>
If <em class="parameter"><code>take_focus</code></em> is <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> (the default) the menu shell will take the keyboard
focus so that it will receive all keyboard events which is needed to enable
keyboard navigation in menus.
</p>
<p>
Setting <em class="parameter"><code>take_focus</code></em> to <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> is useful only for special applications
like virtual keyboard implementations which should not take keyboard
focus.
</p>
<p>
The <em class="parameter"><code>take_focus</code></em> state of a menu or menu bar is automatically propagated
to submenus whenever a submenu is popped up, so you don't have to worry
about recursively setting it for your entire menu hierarchy. Only when
programmatically picking a submenu and popping it up manually, the
<em class="parameter"><code>take_focus</code></em> property of the submenu needs to be set explicitely.
</p>
<p>
Note that setting it to <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> has side-effects:
</p>
<p>
If the focus is in some other app, it keeps the focus and keynav in
the menu doesn't work. Consequently, keynav on the menu will only
work if the focus is on some toplevel owned by the onscreen keyboard.
</p>
<p>
To avoid confusing the user, menus with <em class="parameter"><code>take_focus</code></em> set to <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a>
should not display mnemonics or accelerators, since it cannot be
guaranteed that they will work.
</p>
<p>
See also <a
href="../gdk/gdk-General.html#gdk-keyboard-grab"
><code class="function">gdk_keyboard_grab()</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_shell</code></em> :</span></td>
<td> a <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>take_focus</code></em> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the menu shell should take the keyboard focus on popup.
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3292499"></a><h3>
<a name="gtk-menu-shell-get-take-focus"></a>gtk_menu_shell_get_take_focus ()</h3>
<a class="indexterm" name="id3292515"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gtk_menu_shell_get_take_focus (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menu_shell);</pre>
<p>
Returns <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the menu shell will take the keyboard focus on popup.</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_shell</code></em> :</span></td>
<td> a <a href="GtkMenuShell.html" title="GtkMenuShell"><span class="type">GtkMenuShell</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 shell will take the keyboard focus on popup.
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.8
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3292610"></a><h3>
<a name="GtkMenuDirectionType"></a>enum GtkMenuDirectionType</h3>
<a class="indexterm" name="id3292623"></a><pre class="programlisting">typedef enum
{
GTK_MENU_DIR_PARENT,
GTK_MENU_DIR_CHILD,
GTK_MENU_DIR_NEXT,
GTK_MENU_DIR_PREV
} GtkMenuDirectionType;
</pre>
<p>
An enumeration representing directional movements within a menu.
</p>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td>GTK_MENU_DIR_PARENT</td>
<td>To the parent menu shell.</td>
</tr>
<tr>
<td>GTK_MENU_DIR_CHILD</td>
<td>To the submenu, if any, associated with the item.</td>
</tr>
<tr>
<td>GTK_MENU_DIR_NEXT</td>
<td>To the next menu item.</td>
</tr>
<tr>
<td>GTK_MENU_DIR_PREV</td>
<td>To the previous menu item.</td>
</tr>
</tbody>
</table></div>
<p>
</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3292707"></a><h2>Property Details</h2>
<div class="refsect2" lang="en">
<a name="id3292718"></a><h3>
<a name="GtkMenuShell--take-focus"></a>The "<code class="literal">take-focus</code>" property</h3>
<a class="indexterm" name="id3292734"></a><pre class="programlisting"> "take-focus" <a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> : Read / Write</pre>
<p>
A boolean that determines whether the menu and its submenus grab the
keyboard focus. See <a href="GtkMenuShell.html#gtk-menu-shell-set-take-focus"><code class="function">gtk_menu_shell_set_take_focus()</code></a> and
<a href="GtkMenuShell.html#gtk-menu-shell-get-take-focus"><code class="function">gtk_menu_shell_get_take_focus()</code></a>.</p>
<p>
</p>
<p>Default value: TRUE</p>
<p>Since 2.8
</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3292794"></a><h2>Signal Details</h2>
<div class="refsect2" lang="en">
<a name="id3292805"></a><h3>
<a name="GtkMenuShell-activate-current"></a>The "activate-current" signal</h3>
<a class="indexterm" name="id3292816"></a><pre class="programlisting">void user_function (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menushell,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> force_hide,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last / Action</pre>
<p>
An action signal that activates the current menu item within the menu
shell.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menushell</code></em> :</span></td>
<td>the object which received the signal.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>force_hide</code></em> :</span></td>
<td>if TRUE, hide the menu after activating the menu item.
</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="id3292908"></a><h3>
<a name="GtkMenuShell-cancel"></a>The "cancel" signal</h3>
<a class="indexterm" name="id3292918"></a><pre class="programlisting">void user_function (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menushell,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last / Action</pre>
<p>
An action signal which cancels the selection within the menu shell.
Causes the GtkMenuShell::selection-done signal to be emitted.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menushell</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="id3292989"></a><h3>
<a name="GtkMenuShell-cycle-focus"></a>The "cycle-focus" signal</h3>
<a class="indexterm" name="id3292999"></a><pre class="programlisting">void user_function (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menushell,
<a href="gtk-Standard-Enumerations.html#GtkDirectionType">GtkDirectionType</a> *arg1,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last / Action</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menushell</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="id3293090"></a><h3>
<a name="GtkMenuShell-deactivate"></a>The "deactivate" signal</h3>
<a class="indexterm" name="id3293100"></a><pre class="programlisting">void user_function (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menushell,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run first</pre>
<p>
This signal is emitted when a menu shell is deactivated.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menushell</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="id3293170"></a><h3>
<a name="GtkMenuShell-move-current"></a>The "move-current" signal</h3>
<a class="indexterm" name="id3293181"></a><pre class="programlisting">void user_function (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menushell,
<a href="GtkMenuShell.html#GtkMenuDirectionType">GtkMenuDirectionType</a> direction,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run last / Action</pre>
<p>
An action signal which moves the current menu item in the direction
specified by <em class="parameter"><code>direction</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menushell</code></em> :</span></td>
<td>the object which received the signal.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>direction</code></em> :</span></td>
<td>the direction to move.
</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="id3293279"></a><h3>
<a name="GtkMenuShell-selection-done"></a>The "selection-done" signal</h3>
<a class="indexterm" name="id3293290"></a><pre class="programlisting">void user_function (<a href="GtkMenuShell.html" title="GtkMenuShell">GtkMenuShell</a> *menushell,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data) : Run first</pre>
<p>
This signal is emitted when a selection has been completed within a menu
shell.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>menushell</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>
</div>
</div>
</body>
</html>