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

<refnamediv>
<refname>GtkMenuShell</refname>
<refpurpose>A base class for menu objects</refpurpose>
</refnamediv>

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

<synopsis>

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

                    <link linkend="GtkMenuShell-struct">GtkMenuShell</link>;
<link linkend="void">void</link>                <link linkend="gtk-menu-shell-append">gtk_menu_shell_append</link>               (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="GtkWidget">GtkWidget</link> *child);
<link linkend="void">void</link>                <link linkend="gtk-menu-shell-prepend">gtk_menu_shell_prepend</link>              (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="GtkWidget">GtkWidget</link> *child);
<link linkend="void">void</link>                <link linkend="gtk-menu-shell-insert">gtk_menu_shell_insert</link>               (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="GtkWidget">GtkWidget</link> *child,
                                                         <link linkend="gint">gint</link> position);
<link linkend="void">void</link>                <link linkend="gtk-menu-shell-deactivate">gtk_menu_shell_deactivate</link>           (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell);
<link linkend="void">void</link>                <link linkend="gtk-menu-shell-select-item">gtk_menu_shell_select_item</link>          (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="GtkWidget">GtkWidget</link> *menu_item);
<link linkend="void">void</link>                <link linkend="gtk-menu-shell-select-first">gtk_menu_shell_select_first</link>         (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="gboolean">gboolean</link> search_sensitive);
<link linkend="void">void</link>                <link linkend="gtk-menu-shell-deselect">gtk_menu_shell_deselect</link>             (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell);
<link linkend="void">void</link>                <link linkend="gtk-menu-shell-activate-item">gtk_menu_shell_activate_item</link>        (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="GtkWidget">GtkWidget</link> *menu_item,
                                                         <link linkend="gboolean">gboolean</link> force_deactivate);
<link linkend="void">void</link>                <link linkend="gtk-menu-shell-cancel">gtk_menu_shell_cancel</link>               (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell);
<link linkend="void">void</link>                <link linkend="gtk-menu-shell-set-take-focus">gtk_menu_shell_set_take_focus</link>       (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="gboolean">gboolean</link> take_focus);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-menu-shell-get-take-focus">gtk_menu_shell_get_take_focus</link>       (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell);
enum                <link linkend="GtkMenuDirectionType">GtkMenuDirectionType</link>;
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkMenuShell.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>
                           +----GtkMenuShell
                                 +----<link linkend="GtkMenuBar">GtkMenuBar</link>
                                 +----<link linkend="GtkMenu">GtkMenu</link>
</synopsis>
</refsect1>



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


<refsect1 id="GtkMenuShell.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkMenuShell--take-focus">take-focus</link>&quot;               <link linkend="gboolean">gboolean</link>              : Read / Write
</synopsis>
</refsect1>

<refsect1 id="GtkMenuShell.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GtkMenuShell-activate-current">activate-current</link>&quot;                               : Run Last / Action
  &quot;<link linkend="GtkMenuShell-cancel">cancel</link>&quot;                                         : Run Last / Action
  &quot;<link linkend="GtkMenuShell-cycle-focus">cycle-focus</link>&quot;                                    : Run Last / Action
  &quot;<link linkend="GtkMenuShell-deactivate">deactivate</link>&quot;                                     : Run First
  &quot;<link linkend="GtkMenuShell-move-current">move-current</link>&quot;                                   : Run Last / Action
  &quot;<link linkend="GtkMenuShell-move-selected">move-selected</link>&quot;                                  : Run Last
  &quot;<link linkend="GtkMenuShell-selection-done">selection-done</link>&quot;                                 : Run First
</synopsis>
</refsect1>


<refsect1 id="GtkMenuShell.description" role="desc">
<title role="desc.title">Description</title>
<para>
A <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link> is the abstract base class used to derive the
<link linkend="GtkMenu"><type>GtkMenu</type></link> and <link linkend="GtkMenuBar"><type>GtkMenuBar</type></link> subclasses.
</para>
<para>
A <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link> is a container of <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> objects arranged in a
list which can be navigated, selected, and activated by the user to perform
application functions.  A <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> can have a submenu associated with it,
allowing for nested hierarchical menus.
</para>
</refsect1>

<refsect1 id="GtkMenuShell.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkMenuShell-struct" role="struct">
<title>GtkMenuShell</title>
<indexterm zone="GtkMenuShell-struct"><primary sortas="MenuShell">GtkMenuShell</primary></indexterm><programlisting>typedef struct _GtkMenuShell GtkMenuShell;</programlisting>
<para>
The <link linkend="GtkMenuShell-struct"><type>GtkMenuShell</type></link> struct contains the following fields.
(These fields should be considered read-only. They should never be set by
an application.)
<informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
<tbody>
<row>
<entry><link linkend="GList"><type>GList</type></link> *children;</entry>
<entry>The list of <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> objects contained by this <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link>.
</entry>
</row>
</tbody></tgroup></informaltable>
</para></refsect2>
<refsect2 id="gtk-menu-shell-append" role="function">
<title>gtk_menu_shell_append ()</title>
<indexterm zone="gtk-menu-shell-append"><primary sortas="menu_shell_append">gtk_menu_shell_append</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_shell_append               (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="GtkWidget">GtkWidget</link> *child);</programlisting>
<para>
Adds a new <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> to the end of the menu shell's item list.
</para><variablelist role="params">
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>child</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> to add.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-shell-prepend" role="function">
<title>gtk_menu_shell_prepend ()</title>
<indexterm zone="gtk-menu-shell-prepend"><primary sortas="menu_shell_prepend">gtk_menu_shell_prepend</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_shell_prepend              (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="GtkWidget">GtkWidget</link> *child);</programlisting>
<para>
Adds a new <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> to the beginning of the menu shell's item list.
</para><variablelist role="params">
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>child</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> to add.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-shell-insert" role="function">
<title>gtk_menu_shell_insert ()</title>
<indexterm zone="gtk-menu-shell-insert"><primary sortas="menu_shell_insert">gtk_menu_shell_insert</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_shell_insert               (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="GtkWidget">GtkWidget</link> *child,
                                                         <link linkend="gint">gint</link> position);</programlisting>
<para>
Adds a new <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> to the menu shell's item list at the position
indicated by <parameter>position</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>child</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> to add.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>position</parameter>&#160;:</term>
<listitem><simpara>The position in the item list where <parameter>child</parameter> is added.
Positions are numbered from 0 to n-1.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-shell-deactivate" role="function">
<title>gtk_menu_shell_deactivate ()</title>
<indexterm zone="gtk-menu-shell-deactivate"><primary sortas="menu_shell_deactivate">gtk_menu_shell_deactivate</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_shell_deactivate           (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell);</programlisting>
<para>
Deactivates the menu shell.  Typically this results in the menu shell
being erased from the screen.
</para><variablelist role="params">
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-shell-select-item" role="function">
<title>gtk_menu_shell_select_item ()</title>
<indexterm zone="gtk-menu-shell-select-item"><primary sortas="menu_shell_select_item">gtk_menu_shell_select_item</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_shell_select_item          (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="GtkWidget">GtkWidget</link> *menu_item);</programlisting>
<para>
Selects the menu item from the menu shell.
</para><variablelist role="params">
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> to select.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-shell-select-first" role="function" condition="since:2.2">
<title>gtk_menu_shell_select_first ()</title>
<indexterm zone="gtk-menu-shell-select-first" role="2.2"><primary sortas="menu_shell_select_first">gtk_menu_shell_select_first</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_shell_select_first         (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="gboolean">gboolean</link> search_sensitive);</programlisting>
<para>
Select the first visible or selectable child of the menu shell;
don't select tearoff items unless the only item is a tearoff
item.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>search_sensitive</parameter>&#160;:</term>
<listitem><simpara> if <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, search for the first selectable
                   menu item, otherwise select nothing if
                   the first item isn't sensitive. This
                   should be <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> if the menu is being
                   popped up initially.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gtk-menu-shell-deselect" role="function">
<title>gtk_menu_shell_deselect ()</title>
<indexterm zone="gtk-menu-shell-deselect"><primary sortas="menu_shell_deselect">gtk_menu_shell_deselect</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_shell_deselect             (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell);</programlisting>
<para>
Deselects the currently selected item from the menu shell, if any.
</para><variablelist role="params">
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-shell-activate-item" role="function">
<title>gtk_menu_shell_activate_item ()</title>
<indexterm zone="gtk-menu-shell-activate-item"><primary sortas="menu_shell_activate_item">gtk_menu_shell_activate_item</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_shell_activate_item        (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="GtkWidget">GtkWidget</link> *menu_item,
                                                         <link linkend="gboolean">gboolean</link> force_deactivate);</programlisting>
<para>
Activates the menu item within the menu shell.
</para><variablelist role="params">
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>menu_item</parameter>&#160;:</term>
<listitem><simpara>The <link linkend="GtkMenuItem"><type>GtkMenuItem</type></link> to activate.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>force_deactivate</parameter>&#160;:</term>
<listitem><simpara>If TRUE, force the deactivation of the menu shell
after the menu item is activated.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-menu-shell-cancel" role="function" condition="since:2.4">
<title>gtk_menu_shell_cancel ()</title>
<indexterm zone="gtk-menu-shell-cancel" role="2.4"><primary sortas="menu_shell_cancel">gtk_menu_shell_cancel</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_shell_cancel               (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell);</programlisting>
<para>
Cancels the selection within the menu shell.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="gtk-menu-shell-set-take-focus" role="function" condition="since:2.8">
<title>gtk_menu_shell_set_take_focus ()</title>
<indexterm zone="gtk-menu-shell-set-take-focus" role="2.8"><primary sortas="menu_shell_set_take_focus">gtk_menu_shell_set_take_focus</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_menu_shell_set_take_focus       (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                         <link linkend="gboolean">gboolean</link> take_focus);</programlisting>
<para>
If <parameter>take_focus</parameter> is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> (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.
</para>
<para>
Setting <parameter>take_focus</parameter> to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> is useful only for special applications
like virtual keyboard implementations which should not take keyboard
focus.
</para>
<para>
The <parameter>take_focus</parameter> 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
<parameter>take_focus</parameter> property of the submenu needs to be set explicitely.
</para>
<para>
Note that setting it to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> has side-effects:
</para>
<para>
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.
</para>
<para>
To avoid confusing the user, menus with <parameter>take_focus</parameter> set to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>
should not display mnemonics or accelerators, since it cannot be
guaranteed that they will work.
</para>
<para>
See also <link linkend="gdk-keyboard-grab"><function>gdk_keyboard_grab()</function></link></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuShell"><type>GtkMenuShell</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>take_focus</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the menu shell should take the keyboard focus on popup.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.8</para></refsect2>
<refsect2 id="gtk-menu-shell-get-take-focus" role="function" condition="since:2.8">
<title>gtk_menu_shell_get_take_focus ()</title>
<indexterm zone="gtk-menu-shell-get-take-focus" role="2.8"><primary sortas="menu_shell_get_take_focus">gtk_menu_shell_get_take_focus</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_menu_shell_get_take_focus       (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell);</programlisting>
<para>
Returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the menu shell will take the keyboard focus on popup.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkMenuShell"><type>GtkMenuShell</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 shell will take the keyboard focus on popup.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.8</para></refsect2>
<refsect2 id="GtkMenuDirectionType" role="enum">
<title>enum GtkMenuDirectionType</title>
<indexterm zone="GtkMenuDirectionType"><primary sortas="MenuDirectionType">GtkMenuDirectionType</primary></indexterm><programlisting>typedef enum
{
  GTK_MENU_DIR_PARENT,
  GTK_MENU_DIR_CHILD,
  GTK_MENU_DIR_NEXT,
  GTK_MENU_DIR_PREV
} GtkMenuDirectionType;
</programlisting>
<para>
An enumeration representing directional movements within a menu.
</para><variablelist role="enum">
<varlistentry id="GTK-MENU-DIR-PARENT--CAPS" role="constant">
<term><literal>GTK_MENU_DIR_PARENT</literal></term>
<listitem><simpara>To the parent menu shell.
</simpara></listitem>
</varlistentry>
<varlistentry id="GTK-MENU-DIR-CHILD--CAPS" role="constant">
<term><literal>GTK_MENU_DIR_CHILD</literal></term>
<listitem><simpara>To the submenu, if any, associated with the item.
</simpara></listitem>
</varlistentry>
<varlistentry id="GTK-MENU-DIR-NEXT--CAPS" role="constant">
<term><literal>GTK_MENU_DIR_NEXT</literal></term>
<listitem><simpara>To the next menu item.
</simpara></listitem>
</varlistentry>
<varlistentry id="GTK-MENU-DIR-PREV--CAPS" role="constant">
<term><literal>GTK_MENU_DIR_PREV</literal></term>
<listitem><simpara>To the previous menu item.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="GtkMenuShell.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkMenuShell--take-focus" role="property"><title>The <literal>&quot;take-focus&quot;</literal> property</title>
<indexterm zone="GtkMenuShell--take-focus" role="2.8"><primary sortas="MenuShell:take-focus">GtkMenuShell:take-focus</primary></indexterm><programlisting>  &quot;take-focus&quot;               <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>
A boolean that determines whether the menu and its submenus grab the
keyboard focus. See <link linkend="gtk-menu-shell-set-take-focus"><function>gtk_menu_shell_set_take_focus()</function></link> and
<link linkend="gtk-menu-shell-get-take-focus"><function>gtk_menu_shell_get_take_focus()</function></link>.</para>
<para>
</para><para>Default value: TRUE</para>
<para>Since 2.8</para>
</refsect2>
</refsect1>

<refsect1 id="GtkMenuShell.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkMenuShell-activate-current" role="signal"><title>The <literal>&quot;activate-current&quot;</literal> signal</title>
<indexterm zone="GtkMenuShell-activate-current"><primary sortas="MenuShell::activate-current">GtkMenuShell::activate-current</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkMenuShell">GtkMenuShell</link> *menushell,
                                                        <link linkend="gboolean">gboolean</link>      force_hide,
                                                        <link linkend="gpointer">gpointer</link>      user_data)       : Run Last / Action</programlisting>
<para>
An action signal that activates the current menu item within the menu
shell.
</para><variablelist role="params">
<varlistentry><term><parameter>menushell</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>force_hide</parameter>&#160;:</term>
<listitem><simpara>if TRUE, hide the menu after activating the menu item.
</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="GtkMenuShell-cancel" role="signal"><title>The <literal>&quot;cancel&quot;</literal> signal</title>
<indexterm zone="GtkMenuShell-cancel"><primary sortas="MenuShell::cancel">GtkMenuShell::cancel</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkMenuShell">GtkMenuShell</link> *menushell,
                                                        <link linkend="gpointer">gpointer</link>      user_data)      : Run Last / Action</programlisting>
<para>
An action signal which cancels the selection within the menu shell.
Causes the GtkMenuShell::selection-done signal to be emitted.
</para><variablelist role="params">
<varlistentry><term><parameter>menushell</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="GtkMenuShell-cycle-focus" role="signal"><title>The <literal>&quot;cycle-focus&quot;</literal> signal</title>
<indexterm zone="GtkMenuShell-cycle-focus"><primary sortas="MenuShell::cycle-focus">GtkMenuShell::cycle-focus</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkMenuShell">GtkMenuShell</link>    *menushell,
                                                        <link linkend="GtkDirectionType">GtkDirectionType</link> arg1,
                                                        <link linkend="gpointer">gpointer</link>         user_data)      : Run Last / Action</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menushell</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="GtkMenuShell-deactivate" role="signal"><title>The <literal>&quot;deactivate&quot;</literal> signal</title>
<indexterm zone="GtkMenuShell-deactivate"><primary sortas="MenuShell::deactivate">GtkMenuShell::deactivate</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkMenuShell">GtkMenuShell</link> *menushell,
                                                        <link linkend="gpointer">gpointer</link>      user_data)      : Run First</programlisting>
<para>
This signal is emitted when a menu shell is deactivated.
</para><variablelist role="params">
<varlistentry><term><parameter>menushell</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="GtkMenuShell-move-current" role="signal"><title>The <literal>&quot;move-current&quot;</literal> signal</title>
<indexterm zone="GtkMenuShell-move-current"><primary sortas="MenuShell::move-current">GtkMenuShell::move-current</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkMenuShell">GtkMenuShell</link>        *menushell,
                                                        <link linkend="GtkMenuDirectionType">GtkMenuDirectionType</link> direction,
                                                        <link linkend="gpointer">gpointer</link>             user_data)      : Run Last / Action</programlisting>
<para>
An action signal which moves the current menu item in the direction
specified by <parameter>direction</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>menushell</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>direction</parameter>&#160;:</term>
<listitem><simpara>the direction to move.
</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="GtkMenuShell-move-selected" role="signal"><title>The <literal>&quot;move-selected&quot;</literal> signal</title>
<indexterm zone="GtkMenuShell-move-selected" role="2.12"><primary sortas="MenuShell::move-selected">GtkMenuShell::move-selected</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            user_function                      (<link linkend="GtkMenuShell">GtkMenuShell</link> *menu_shell,
                                                        <link linkend="gint">gint</link>          distance,
                                                        <link linkend="gpointer">gpointer</link>      user_data)       : Run Last</programlisting>
<para>
The ::move-selected signal is emitted to move the selection to
another item.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>menu_shell</parameter>&#160;:</term>
<listitem><simpara> the object on which the signal is emitted
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>distance</parameter>&#160;:</term>
<listitem><simpara> +1 to move to the next item, -1 to move to the previous
</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>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> to stop the signal emission, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> to continue
</simpara></listitem></varlistentry>
</variablelist><para>Since 2.12</para></refsect2><refsect2 id="GtkMenuShell-selection-done" role="signal"><title>The <literal>&quot;selection-done&quot;</literal> signal</title>
<indexterm zone="GtkMenuShell-selection-done"><primary sortas="MenuShell::selection-done">GtkMenuShell::selection-done</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkMenuShell">GtkMenuShell</link> *menushell,
                                                        <link linkend="gpointer">gpointer</link>      user_data)      : Run First</programlisting>
<para>
This signal is emitted when a selection has been completed within a menu
shell.
</para><variablelist role="params">
<varlistentry><term><parameter>menushell</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>
</refsect1>



</refentry>
